summaryrefslogtreecommitdiff
path: root/fs/fuse
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2019-06-05 08:04:51 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2019-06-09 10:07:07 -0700
commitfe0da9c09b2dc448ff781d1426ecb36d145ce51b (patch)
tree368b9c4126a747858b39d301f818b153019ce28b /fs/fuse
parent5dae222a5ff0c269730393018a5539cc970a4726 (diff)
fuse: copy_file_range needs to strip setuid bits and update timestamps
Like ->write_iter(), we update mtime and strip setuid of dst file before copy and like ->read_iter(), we update atime of src file after copy. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Acked-by: Miklos Szeredi <miklos@szeredi.hu> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index dc342edb399b..5ae2828beb00 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -3155,6 +3155,10 @@ static ssize_t __fuse_copy_file_range(struct file *file_in, loff_t pos_in,
inode_lock(inode_out);
+ err = file_modified(file_out);
+ if (err)
+ goto out;
+
if (fc->writeback_cache) {
err = fuse_writeback_range(inode_out, pos_out, pos_out + len);
if (err)
@@ -3193,6 +3197,7 @@ out:
clear_bit(FUSE_I_SIZE_UNSTABLE, &fi_out->state);
inode_unlock(inode_out);
+ file_accessed(file_in);
return err;
}