fuse: make written data persistent after writing
Subsystems (2)
PATCH 1/1 fuse: make written data persistent after writing
If this is a DSYNC write, make sure we push it to stable storage now that we've written data.
---
This patch is based on 5.5-rc5.
fs/fuse/file.c | 2 ++ 1 file changed, 2 insertions(+)
fs/fuse/file.c +2 -0
@@ -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; }
Signature · 1 line
1.8.3.1
Quoted 9 lines · Liu Bo
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 <[email protected]>---
This patch is based on 5.5-rc5.fs/fuse/file.c | 2 ++ 1 file changed, 2 insertions(+)
Miklos Szeredi
maintainerQuoted 3 lines · Liu Bo
If this is a DSYNC write, make sure we push it to stable storage now that we've written data.
If this is direct I/O then why do we need an fysnc() call?
The only thing needed should be correct setting O_DSYNC in the flags field of the WRITE request, and it appears to me that that is already being done.
Thanks,
Miklos
Quoted 10 lines · Miklos Szeredi
Quoted 3 lines · Liu Bo
If this is a DSYNC write, make sure we push it to stable storage now that we've written data.
If this is direct I/O then why do we need an
fysnc()call?The only thing needed should be correct setting
O_DSYNCin the flags field of the WRITE request, and it appears to me that that is already being done.
Given direct IO itself doesn't guarantee FUA or FLUSH, I think we still need such a fsync() call to make sure a FUA/FLUSH is sent after direct IO.
thanks,
-liubo
Miklos Szeredi
maintainerQuoted 9 lines · Liu Bo
Quoted 7 lines · Miklos Szeredi
Quoted 3 lines · Liu Bo
If this is a DSYNC write, make sure we push it to stable storage now that we've written data.
If this is direct I/O then why do we need an
fysnc()call?
Quoted 7 lines
Quoted 3 lines
The only thing needed should be correct setting
O_DSYNCin the flags field of the WRITE request, and it appears to me that that is already being done.Given direct IO itself doesn't guarantee FUA or FLUSH, I think we still need such a
fsync()call to make sure a FUA/FLUSH is sent after direct IO.
What I mean is that the server itself can call fsync(2) from the WRITE request if it finds that fi->flags contains O_DSYNC.
Thanks,
Miklos
Quoted 14 lines · Miklos Szeredi
Quoted 13 lines · Liu Bo
Quoted 10 lines · Miklos Szeredi
Quoted 3 lines · Liu Bo
If this is a DSYNC write, make sure we push it to stable storage now that we've written data.
If this is direct I/O then why do we need an
fysnc()call?The only thing needed should be correct setting
O_DSYNCin the flags field of the WRITE request, and it appears to me that that is already being done.
Quoted 6 lines
Quoted 3 lines
Given direct IO itself doesn't guarantee FUA or FLUSH, I think we still need such a
fsync()call to make sure a FUA/FLUSH is sent after direct IO.What I mean is that the server itself can call fsync(2) from the WRITE request if it finds that
fi->flagscontainsO_DSYNC.
Right, I missed that with no_open FUSE_DIRECT_IO is not possible, thanks for clarifying it.
thanks,
-liubo