Skip to content

Commit

Permalink
f2fs: avoid unneeded data copy in f2fs_ioc_move_range()
Browse files Browse the repository at this point in the history
[ Upstream commit 3a1b9ea ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
chaseyu authored and gregkh committed May 19, 2021
1 parent 758fd22 commit 23ecfe7
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions fs/f2fs/file.c
Expand Up @@ -2913,12 +2913,6 @@ static int __f2fs_ioc_move_range(struct file *filp,
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;
Expand Down

0 comments on commit 23ecfe7

Please sign in to comment.