linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: avoid unneeded data copy in f2fs_ioc_move_range()
@ 2020-11-09 16:59 Jaegeuk Kim
  2020-11-09 17:00 ` Jaegeuk Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2020-11-09 16:59 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Chao Yu, Jaegeuk Kim

From: Chao Yu <yuchao0@huawei.com>

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>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/file.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 52417a2e3f4f..22ae8ae0072f 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;
-- 
2.29.2.222.g5d2a92d10f8-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] f2fs: avoid unneeded data copy in f2fs_ioc_move_range()
  2020-11-09 16:59 [PATCH] f2fs: avoid unneeded data copy in f2fs_ioc_move_range() Jaegeuk Kim
@ 2020-11-09 17:00 ` Jaegeuk Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2020-11-09 17:00 UTC (permalink / raw)
  To: linux-kernel, linux-f2fs-devel, kernel-team; +Cc: Chao Yu

Sorry, please ignore this.

On 11/09, Jaegeuk Kim wrote:
> From: Chao Yu <yuchao0@huawei.com>
> 
> 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>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  fs/f2fs/file.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index 52417a2e3f4f..22ae8ae0072f 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;
> -- 
> 2.29.2.222.g5d2a92d10f8-goog

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] f2fs: avoid unneeded data copy in f2fs_ioc_move_range()
@ 2020-11-09 16:58 Jaegeuk Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2020-11-09 16:58 UTC (permalink / raw)
  To: linux-kernel, linux-scsi, kernel-team; +Cc: Chao Yu, Jaegeuk Kim

From: Chao Yu <yuchao0@huawei.com>

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>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/file.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 52417a2e3f4f..22ae8ae0072f 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;
-- 
2.29.2.222.g5d2a92d10f8-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-09 17:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 16:59 [PATCH] f2fs: avoid unneeded data copy in f2fs_ioc_move_range() Jaegeuk Kim
2020-11-09 17:00 ` Jaegeuk Kim
  -- strict thread matches above, loose matches on Subject: below --
2020-11-09 16:58 Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).