mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
virtiofsd: Make fsync work even if only inode is passed in
If caller has not sent file handle in request, then using inode, retrieve the fd opened using O_PATH and use that to open file again and issue fsync. This will be needed when dax_flush() calls fsync. At that time we only have inode information (and not file). Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
9776457ca6
commit
1b209805f8
2 changed files with 32 additions and 4 deletions
|
@ -1075,7 +1075,11 @@ static void do_fsync(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
|
|||
fi.fh = arg->fh;
|
||||
|
||||
if (req->se->op.fsync) {
|
||||
req->se->op.fsync(req, nodeid, datasync, &fi);
|
||||
if (fi.fh == (uint64_t)-1) {
|
||||
req->se->op.fsync(req, nodeid, datasync, NULL);
|
||||
} else {
|
||||
req->se->op.fsync(req, nodeid, datasync, &fi);
|
||||
}
|
||||
} else {
|
||||
fuse_reply_err(req, ENOSYS);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue