linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fuse: make written data persistent after writing
@ 2020-03-03 21:15 Liu Bo
  2020-03-09 11:20 ` [Virtio-fs] " Stefan Hajnoczi
  2020-03-10 10:14 ` Miklos Szeredi
  0 siblings, 2 replies; 6+ messages in thread
From: Liu Bo @ 2020-03-03 21:15 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Miklos Szeredi, virtio-fs

If this is a DSYNC write, make sure we push it to stable storage now
that we've written data.

Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
---
This patch is based on 5.5-rc5.

 fs/fuse/file.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index a63d779eac10..08e3df618d7f 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1541,6 +1541,8 @@ static ssize_t fuse_direct_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	if (res > 0)
 		fuse_write_update_size(inode, iocb->ki_pos);
 	inode_unlock(inode);
+	if (res > 0)
+		res = generic_write_sync(iocb, res);
 
 	return res;
 }
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-11  4:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-03 21:15 [PATCH] fuse: make written data persistent after writing Liu Bo
2020-03-09 11:20 ` [Virtio-fs] " Stefan Hajnoczi
2020-03-10 10:14 ` Miklos Szeredi
2020-03-10 18:46   ` Liu Bo
2020-03-10 19:08     ` Miklos Szeredi
2020-03-11  4:58       ` Liu Bo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).