From: Liu Bo <bo.liu@linux.alibaba.com>
To: linux-fsdevel@vger.kernel.org
Cc: Miklos Szeredi <mszeredi@redhat.com>, virtio-fs@redhat.com
Subject: [PATCH] fuse: make written data persistent after writing
Date: Wed, 4 Mar 2020 05:15:11 +0800 [thread overview]
Message-ID: <1583270111-76859-1-git-send-email-bo.liu@linux.alibaba.com> (raw)
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
next reply other threads:[~2020-03-03 21:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 21:15 Liu Bo [this message]
2020-03-09 11:20 ` [Virtio-fs] [PATCH] fuse: make written data persistent after writing 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1583270111-76859-1-git-send-email-bo.liu@linux.alibaba.com \
--to=bo.liu@linux.alibaba.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=virtio-fs@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).