diff options
author | Chao Yu <yuchao0@huawei.com> | 2020-11-10 09:24:36 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-12-02 22:00:20 -0800 |
commit | 3a1b9eaf727b4ab84ebf059e09c38fc6a53e5614 (patch) | |
tree | 3ae23231f3cd67ecba7b01ee4a6fc45e72c6258e | |
parent | e1e8debec6564d0c355aab84c93de8e357f397bd (diff) | |
download | linux-3a1b9eaf727b4ab84ebf059e09c38fc6a53e5614.tar.gz linux-3a1b9eaf727b4ab84ebf059e09c38fc6a53e5614.tar.bz2 linux-3a1b9eaf727b4ab84ebf059e09c38fc6a53e5614.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.c | 6 |
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) range.pos_out, range.len); mnt_drop_write_file(filp); - if (err) - goto err_out; - - if (copy_to_user((struct f2fs_move_range __user *)arg, - &range, sizeof(range))) - err = -EFAULT; err_out: fdput(dst); return err; |