Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp545438pxj; Tue, 18 May 2021 08:59:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzj6Zs+NMcriBaVepBiU/2lZhnwjn4hFeL4OWlAmyAXEA5gK7ovYcLpG9WTYBV30I36Kpv4 X-Received: by 2002:aa7:d61a:: with SMTP id c26mr8000245edr.351.1621353578714; Tue, 18 May 2021 08:59:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621353578; cv=none; d=google.com; s=arc-20160816; b=GxZsxhNHcCzUbFBDYm8r76VMkXysOAErmoGpSZR1wVlX6SxpNF62Og41lGBGWf3A4g GiH7nU3xfNE2TW8ohdw8bQQhKLFcS/4/+NrWTD56uEMeMSv3xMWn8PBBNlU1eqYTDswe lJfnaEWjHp95FnOukzpWKo63YHaJ5D/8A+W/qP4hcycFePyAyiSGMPVXQzA/rCB/QMgO bEbISp7+JnAUVKeo9CE+kmqv2SYvntm7M9dlyf3iyKzvNQNVsIxaZsaWBiXjTnRKJ+Kt tRtJ5AN2BNcUDMirthSoeK/OWxK9vRsTpeChOIVa4gCacPH1JrAraLMZLkhmTx5wYSd4 Docw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CbnJE5FFi27Be/qwX0Js9LPRXEMob40qo4Ef8X/YM+o=; b=pSLUQSwodxNZBNiR0SG5icX8lzjdJIcdz4JuEaVzIrColulfDf9wuk53zPbAfO1jTr sAC/yzoSyg1eeGcp0DcRp5FRE+W6vmk8d6qXrjaHDGsVonUz1pfPHz43uyc1QtP6EpmQ dUEVMbjqR0SIC7yMHPBQXVEux/WKLdDZsoQ31byqIK6nij4wQ4EXbMESIa+tAtBwXbr1 if76bp9ZG/BTQWDGiB3WHAS00lGU1uSQkOwxsD+J5azP+7Pitr38HOX/d9fzlgNhQIYP TH4F6BdSGZ4tm3YvAUX45zzWtICeAPbuE5b9iaMvpHNhK2exRAa0AnAqTUfGkH5cRbC3 K9bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VRXCMWae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k25si10750992ejr.183.2021.05.18.08.59.15; Tue, 18 May 2021 08:59:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VRXCMWae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346017AbhEQP56 (ORCPT + 99 others); Mon, 17 May 2021 11:57:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:50168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244966AbhEQPi6 (ORCPT ); Mon, 17 May 2021 11:38:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3196B61946; Mon, 17 May 2021 14:41:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262466; bh=qAYjFm1d6REHx7asIHAbKhI6yyXQ1YitqL0796GaLa0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VRXCMWaeNXdZACJC8uNPSgpmuUtNA7krW+fQmuMWgfB+qfPdtlYN+vvgxXx/G9ikP 7UW3YUlni8Q68gu+wsuBBtgRj/Z/D4aITLaSTXygy0wdiXCCaCoRcbEEt7UFaeo5ar Yv8E5yQj6Z6ZeuOM8s/Wqaf7XrHgYlpUtyRmoNus= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chao Yu , Eric Biggers , Jaegeuk Kim , Sasha Levin Subject: [PATCH 5.10 193/289] f2fs: avoid unneeded data copy in f2fs_ioc_move_range() Date: Mon, 17 May 2021 16:01:58 +0200 Message-Id: <20210517140311.605707433@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chao Yu [ 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 Reviewed-by: Eric Biggers Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- 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