Commit 614c026e authored by Miklos Szeredi's avatar Miklos Szeredi

fuse: always flush dirty data on close(2)

We want cached data to synced with the userspace filesystem on close(), for
example to allow getting correct st_blocks value.  Do this regardless of
whether the userspace filesystem implements a FLUSH method or not.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent cf576c58
......@@ -445,10 +445,6 @@ static int fuse_flush(struct file *file, fl_owner_t id)
if (is_bad_inode(inode))
return -EIO;
err = 0;
if (fc->no_flush)
goto inval_attr_out;
err = write_inode_now(inode, 1);
if (err)
return err;
......@@ -461,6 +457,10 @@ static int fuse_flush(struct file *file, fl_owner_t id)
if (err)
return err;
err = 0;
if (fc->no_flush)
goto inval_attr_out;
memset(&inarg, 0, sizeof(inarg));
inarg.fh = ff->fh;
inarg.lock_owner = fuse_lock_owner_id(fc, id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment