mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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 <bschubert@ddn.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
committed by
Miklos Szeredi
parent
b359af8275
commit
1ce120dcef
@@ -1619,7 +1619,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter,
|
|||||||
if (!ia)
|
if (!ia)
|
||||||
return -ENOMEM;
|
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);
|
res = filemap_write_and_wait_range(mapping, pos, pos + count - 1);
|
||||||
if (res) {
|
if (res) {
|
||||||
fuse_io_free(ia);
|
fuse_io_free(ia);
|
||||||
|
|||||||
Reference in New Issue
Block a user