aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu2020-11-09 19:24:36 -0600
committerJaegeuk Kim2020-12-21 15:33:12 -0600
commit8db62952247d02f6f7abb517de238b25d698e948 (patch)
tree09c7c5e7257b4fa4c53a3fb95a5e6646469e4428
parent473a98ef92a14d187e09ea0bf40005e2722a1514 (diff)
downloadkernel-8db62952247d02f6f7abb517de238b25d698e948.tar.gz
kernel-8db62952247d02f6f7abb517de238b25d698e948.tar.xz
kernel-8db62952247d02f6f7abb517de238b25d698e948.zip
f2fs: avoid unneeded data copy in f2fs_ioc_move_range()
Fields in struct f2fs_move_range won't change in f2fs_ioc_move_range(), let's avoid copying this structure's data to userspace. Signed-off-by: Chao Yu <yuchao0@huawei.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/file.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index ea2f1ba408c4..861a6697960a 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2898,12 +2898,6 @@ static int f2fs_ioc_move_range(struct file *filp, unsigned long arg)
2898 range.pos_out, range.len); 2898 range.pos_out, range.len);
2899 2899
2900 mnt_drop_write_file(filp); 2900 mnt_drop_write_file(filp);
2901 if (err)
2902 goto err_out;
2903
2904 if (copy_to_user((struct f2fs_move_range __user *)arg,
2905 &range, sizeof(range)))
2906 err = -EFAULT;
2907err_out: 2901err_out:
2908 fdput(dst); 2902 fdput(dst);
2909 return err; 2903 return err;