Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3352648pxb; Mon, 9 Nov 2020 09:00:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNnZMnmNIqJkmDGSnjAhOdzzJf/GJEhPk+/aBVEICJn3QIapPsJ0VZZRDlxoyBy3t9uwiS X-Received: by 2002:a7b:ce0c:: with SMTP id m12mr96557wmc.114.1604941239597; Mon, 09 Nov 2020 09:00:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604941239; cv=none; d=google.com; s=arc-20160816; b=YDiF5zCxe6SnaeZFEf5WCWVWZjfU77ZKrhcMysjZ4FzVgajoK5oQFuoJ+P16CuP+zD qIf08rhdvLbFPpLHhwEcEIupdc8ekwgP3WNvaugRbkzEXpWhAImj5ASxGRX2h663j96m tbLbr6UhD5mv3Ty6MmK5jpVMR0s44ZuIaOms4kO50c+aqB2o4RH7xl1u4Gi7q4Js7/m9 ZlHJnBPh6clqOja9fwnmTgRctvmS3Px9DFS12SH3Qc1N38wMzQf9CLG6e1VyuHuEQMVd ttaupCTNUdugeVeHRU3ZwOXY1InONdW4BA5QUNapFeoaJ3JGnWVETXONqFEMzqmQVix3 y3AA== 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=GFXnnHl7rNsGXHddorsT+B6W2YT99LJ0RHJaMmw0p5uenkjBt14AxH15qQQCTj5Rn4 uVV4g/uEk5Loe52bK6N/d/zuoDS3IrCTMPjgz10mGicWO/OQ365tBsg36nNLI7L86ky2 AmmoiJ7IX+e18v9kYaJ2t1Hv1slLZRqO0/CwWtYIHBMEyD2XBBen0HiVKrkNthKHCcrp d1duap/17/iHFndhr7wo7/O76+Wxkb1vj8vpDg2icExHdWsF2ug6nAAkFUJaYUY79tOy Gz2T+bGCkiboHeyovNwNQyKHo/XhAn6iYFTIs1KZPjAYNByysVOhx+WQBkZpu3KdCS3N tGow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NOlERqMf; 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 p21si1743994edw.573.2020.11.09.09.00.15; Mon, 09 Nov 2020 09:00:39 -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=NOlERqMf; 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 S1730732AbgKIQ67 (ORCPT + 99 others); Mon, 9 Nov 2020 11:58:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:57894 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729776AbgKIQ67 (ORCPT ); Mon, 9 Nov 2020 11:58:59 -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 0E18720789; Mon, 9 Nov 2020 16:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604941139; bh=WGEcmPXvVRi61x7imWKMEdS2fqmM9HkxAxRybtdcPMQ=; h=From:To:Cc:Subject:Date:From; b=NOlERqMfSxbiWBVfsUqkHzGXJN7umYN+eZXwHi0RAx2g40ylf9gwggxhjCN2BJJ8R dYm2OYWPq82xFgNSTabN+Ldbj0mduIMM/kAcEBYWkhNBqPIUm1uP/nNtrSz7i9MYmt NO4x8wKOc65ZWBvIQYNNyi+xL1nwvrvpOpbM4dA4= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, 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:58:57 -0800 Message-Id: <20201109165857.2115554-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