Skip to content

Commit b88dd85

Browse files
bsberndgregkh
authored andcommitted
fuse: Always flush the page cache before FOPEN_DIRECT_IO write
[ Upstream commit 1ce120d ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 05f9aa1 commit b88dd85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/fuse/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter,
16071607
if (!ia)
16081608
return -ENOMEM;
16091609

1610-
if (fopen_direct_io && fc->direct_io_allow_mmap) {
1610+
if (fopen_direct_io) {
16111611
res = filemap_write_and_wait_range(mapping, pos, pos + count - 1);
16121612
if (res) {
16131613
fuse_io_free(ia);

0 commit comments

Comments
 (0)