]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fuse: Always flush the page cache before FOPEN_DIRECT_IO write
authorBernd Schubert <bschubert@ddn.com>
Wed, 22 Oct 2025 22:21:18 +0000 (00:21 +0200)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 13 Nov 2025 13:54:05 +0000 (14:54 +0100)
This was done as condition on direct_io_allow_mmap, but I believe
this is not right, as a file might be open two times - once with
write-back enabled another time with FOPEN_DIRECT_IO.

Signed-off-by: Bernd Schubert <bschubert@ddn.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/file.c

index b60f394df5a33bd775705f64b56b991c472f6cd9..6014d588845cd6b2199b19355777e411a36cac61 100644 (file)
@@ -1619,7 +1619,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter,
        if (!ia)
                return -ENOMEM;
 
-       if (fopen_direct_io && fc->direct_io_allow_mmap) {
+       if (fopen_direct_io) {
                res = filemap_write_and_wait_range(mapping, pos, pos + count - 1);
                if (res) {
                        fuse_io_free(ia);