From: Vitaly Zolotusky <vitaly@xxxxxxxxx> If the IOCB_DSYNC flag is set a sync is not being performed by fuse_file_write_iter. Honor IOCB_DSYNC by invoking generic_write_sync when a write has been successful. generic_write_sync appropriatly syncs the data which was written when IOCB_DSYNC flag is set. Signed-off-by: Vitaly Zolotusky <vitaly@xxxxxxxxx> Signed-off-by: Nate Clark <nate@xxxxxxxxxx> --- fs/fuse/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 3ee4fdc..5e0a39e 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1227,6 +1227,8 @@ static ssize_t fuse_file_write_iter(struct kiocb *iocb, struct iov_iter *from) out: current->backing_dev_info = NULL; inode_unlock(inode); + if (written > 0) + written = generic_write_sync(iocb, written); return written ? written : err; } -- 2.9.4