Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3352903pxb; Mon, 9 Nov 2020 09:00:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7QdDptKxdls+mmBTHfl4DX/XlKLCwWbBAUH0At+yRgEeatB5P8V7qv5zFwm/mes60ao17 X-Received: by 2002:a17:906:39d1:: with SMTP id i17mr15402226eje.284.1604941259180; Mon, 09 Nov 2020 09:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604941259; cv=none; d=google.com; s=arc-20160816; b=DvfA25Z3D+rK5HWmW/iO47ytKQ3+2HhqU4UYMecoW+36qc9BiMpTQsvVddux755FHW ewAlo4bvgmHoY3facDIRbGzW/mhk5JpTLwnddJrgItpQ5g5+pFQXi96FA29kVdxbEWnY a3IDzZ652QEC1i9Pt/ALnghCNSfS7VMxVACtq4RHLt7Scdehf9FUQiAp+obYxuuO1njQ u/Cj93yHG68yw5pT7l4tKEeY255kRgHflQKarbEQfwQsP8SzT/j0LCJC6m2GWUl2MuFv WEQRV2aAZfENuP6UEB1byQiu1MfoIdtK72zR5SN6fDP8QDfmkDpxGmQITQ9NyFOWawHT TxAQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=S1N8hyiWhEk++Gk2eBD08XSMoY3LczPkR4fWutVZMxU=; b=Oo4PYyRpGFNZhGv62bMtjgbT8/O30StiTDi/LOHvqrHzaHSuH2x19IfcBVxFGbLHXB GSvtnUkCf99nvEBdpJ3RNswYmTdMRWMn4KgSOv6tgpwGo7YqAGdqyd4MhhlMBmryN102 yF7EtjgBMfzbsbf2H4dShYXpEsOHCTWqsmGSsUjawzXvkH4RddczFrg+6eaYmckXPpsD t1aZfYhEQxCYzWH6J5yrXNSrE+pUCCTMcX9/GufqN8MKSaPYzW8rGMTTpVbWfOfTT2VP KZWIHd0lGFBzOKK2KgCOSvdxxcXRShPVWLOjd9LO0xcocu7kYMvLdJxGynGeUgV+0eY0 hWhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mbzMWX6T; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec18si7740768ejb.679.2020.11.09.09.00.35; Mon, 09 Nov 2020 09:00:59 -0800 (PST) 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=@kernel.org header.s=default header.b=mbzMWX6T; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730450AbgKIQ7S (ORCPT + 99 others); Mon, 9 Nov 2020 11:59:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:57968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729776AbgKIQ7Q (ORCPT ); Mon, 9 Nov 2020 11:59:16 -0500 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AB17820789; Mon, 9 Nov 2020 16:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604941155; bh=WGEcmPXvVRi61x7imWKMEdS2fqmM9HkxAxRybtdcPMQ=; h=From:To:Cc:Subject:Date:From; b=mbzMWX6TniVjfRm/Dzn3m2IZcq5w1+5WtbJ+g2OhO0bjQwetVouM6RJMdI/rRT2Ne WcYtRaSgGZ9qwSYy8MR8EVzova6W1sGBuPWV2LGAU8wZsDpnzcSxTBm5IlzhbCRaTp E2yAIdN/SO2j939M9w1a0RZPGx86HZ00RdQmipVQ= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Chao Yu , Jaegeuk Kim Subject: [PATCH] f2fs: avoid unneeded data copy in f2fs_ioc_move_range() Date: Mon, 9 Nov 2020 08:59:14 -0800 Message-Id: <20201109165914.2118360-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chao Yu 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 Signed-off-by: Jaegeuk Kim --- 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