From: Bernd Schubert Date: Wed, 22 Oct 2025 22:21:18 +0000 (+0200) Subject: fuse: Always flush the page cache before FOPEN_DIRECT_IO write X-Git-Tag: v6.19-rc1~110^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ce120dcefc056ce8af2486cebbb77a458aad4c3;p=thirdparty%2Fkernel%2Flinux.git fuse: Always flush the page cache before FOPEN_DIRECT_IO write 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 Signed-off-by: Miklos Szeredi --- diff --git a/fs/fuse/file.c b/fs/fuse/file.c index b60f394df5a33..6014d588845cd 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -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);