[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210517140311.605707433@linuxfoundation.org>
Date: Mon, 17 May 2021 16:01:58 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Chao Yu <yuchao0@...wei.com>,
Eric Biggers <ebiggers@...gle.com>,
Jaegeuk Kim <jaegeuk@...nel.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.10 193/289] f2fs: avoid unneeded data copy in f2fs_ioc_move_range()
From: Chao Yu <yuchao0@...wei.com>
[ Upstream commit 3a1b9eaf727b4ab84ebf059e09c38fc6a53e5614 ]
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@...wei.com>
Reviewed-by: Eric Biggers <ebiggers@...gle.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
fs/f2fs/file.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 9f857e5709b6..5c74b2997197 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -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;
--
2.30.2
Powered by blists - more mailing lists