From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DC82C388F7 for ; Mon, 9 Nov 2020 16:59:43 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8796E20789; Mon, 9 Nov 2020 16:59:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="X78lFYtY"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="hVrMOLHN"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="mbzMWX6T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8796E20789 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1kcAW4-0004xx-IY; Mon, 09 Nov 2020 16:59:40 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcAW3-0004xY-A9 for linux-f2fs-devel@lists.sourceforge.net; Mon, 09 Nov 2020 16:59:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=S1N8hyiWhEk++Gk2eBD08XSMoY3LczPkR4fWutVZMxU=; b=X78lFYtYhra8UqnM47m6Jt9Ct2 36CWS4/9eKRIo2QbW7xnnACg4IOCe7w5CXJ+Hc25Nzf+4JxZTuLeLc5PypD4jwVk0fSMqpvJ6SZ2u BRC0yk2lOLCBBZUncGAAQjYj98Ks66Pm/uDKnxmoLSXBYVFkhL03dq40LSBEk3PYEiYg=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=S1N8hyiWhEk++Gk2eBD08XSMoY3LczPkR4fWutVZMxU=; b=h VrMOLHNAjwpJbKGmcn6YcIt4IwXIB8vfbhaHXtMrZ1e8j+EnbDFyH784Oj8ve4lU6D9c0BuAb+i/y KmP15a45IQOidiOirVj4SlGWxlPB2g/XOXawAKqqqKHsqH2GQDEk1YhF2Fef0IkYp3BLo6I/Ikrkc XnUukgHu68g6kvS4=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kcAVx-005pbu-BH for linux-f2fs-devel@lists.sourceforge.net; Mon, 09 Nov 2020 16:59:39 +0000 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 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 X-Headers-End: 1kcAVx-005pbu-BH Subject: [f2fs-dev] [PATCH] f2fs: avoid unneeded data copy in f2fs_ioc_move_range() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaegeuk Kim Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel