From patchwork Wed Jun 21 09:43:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunlei He X-Patchwork-Id: 13287015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3ADF8EB64DC for ; Wed, 21 Jun 2023 09:44:35 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qBuO9-0006AJ-8H; Wed, 21 Jun 2023 09:44:33 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qBuO5-0006AD-PF for linux-f2fs-devel@lists.sourceforge.net; Wed, 21 Jun 2023 09:44:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: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=d9n6hAlwBhaCOVqO1oeth7RtUmcL9lX0Xgg0Awq05to=; b=EywIJxol7/WSU6Qx//k2AMs11u 0rDb+rGnCnZROGW4zGsRgDz852WUVDDMNjR5uDJF7jxyKpFqnmcAIQQYJ5AtjEjbu+I0JhqEgoRaf yilFb9SWwIdbenECS81A9Uq8bEjH43wOPdo4iDPp6WHUGHWn78yDjhz+QvkEADw6zN0Q=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To: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=d9n6hAlwBhaCOVqO1oeth7RtUmcL9lX0Xgg0Awq05to=; b=W przVAY0qHjepd9qJPIFYcz1xd3PZUl2cyMijPPHDBHRZqR1+8D+FtdJJlB4NBiGY4zDBM9M3B8tCW p47YcJdtdBm1nGebcSEmpnpS/YCfD6sOA/xG9tnT81FNsASdusc1CPunCnD3AiYuHPM3VICYvOuCO XmQwfhelvRZjRDUI=; Received: from mail-tyzapc01on2042.outbound.protection.outlook.com ([40.107.117.42] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qBuNz-00AWmH-Do for linux-f2fs-devel@lists.sourceforge.net; Wed, 21 Jun 2023 09:44:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MNnoR2rCULpBceGH1qrKqVw2tL6maIBWOKvu4ItmI4HzMrd+6PA/6rEMgKyDF8WLw8ycn1YZMVlmUl/m5JGgFClFbnsx3IzT2urhugqSUDJx9U7Mfjn6yYFAg/I6dnFqenT5d5iz/AQxwLU7neYKq8a9MtI0Sf1li1y242aNIGTBmUQzL/P/+FGigNH5HKmi7EhY2aVjIUS2347zMfjx7c4wY43pB/PP8FHnvq3ok5UtVeAn9qJ32Uzrshgk1Plex6f/6BzSRguBc0DlZ6GjYopVzFTkMEIVlOVC1UYHlwPucHGCSo8Grv8pUXyVgnqlBEYsXFOCHsSGapmYIoJu7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=d9n6hAlwBhaCOVqO1oeth7RtUmcL9lX0Xgg0Awq05to=; b=Uh6leckUpve0QRHeiBMI9UFh3QoX5VtRJc1pstIeMRkxhQ7NS4h//XHPcSSuKthqqVNzz9d6bv6yzg3+l9nZbw0altk1BsdmUORAiRbrze6IsLb77CVg0gombZPR9L9CwEilNBy9sx4fwml7VwksVJZRkzA5RMPOKtFOddbhLZmUcS62TzgtlBY9mhAxZOBixvCt+IvqoNdUw7Yn7fn/XBAIHlyyynrWWBooF9wR4QDLUUS7Y77aOf6cn3VXt9Pt2utw7PeM3lWFQRLwIiYmhZABHaqVX6BBH/+znD0H/Fc4rCfyaxivQ6lGxWWCzw+qhSQc8bWjn01wvu3VCyOvhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d9n6hAlwBhaCOVqO1oeth7RtUmcL9lX0Xgg0Awq05to=; b=iV2OIaG0Sq9XxQOXhcfDKeth118fPnrWlQ9pg7Whkl2UZRdOghX+zmheGw+bo2qIGg281fHBo6RImqR56AyuEr7ScfYRyZM0iP5ZKlCVZK2bIyedT98rD15QBcJakZLlQzUKz3VeqHhk1kGJZ52H5dhIL+qvgOZ+nQ3egBpuV+g= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from TY2PR02MB4479.apcprd02.prod.outlook.com (2603:1096:404:800e::7) by TY0PR02MB5621.apcprd02.prod.outlook.com (2603:1096:400:1ba::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.21; Wed, 21 Jun 2023 09:44:14 +0000 Received: from TY2PR02MB4479.apcprd02.prod.outlook.com ([fe80::bc4a:4d7a:4c73:76eb]) by TY2PR02MB4479.apcprd02.prod.outlook.com ([fe80::bc4a:4d7a:4c73:76eb%4]) with mapi id 15.20.6521.020; Wed, 21 Jun 2023 09:44:14 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Wed, 21 Jun 2023 17:43:58 +0800 Message-Id: <20230621094359.3827832-1-heyunlei@oppo.com> X-Mailer: git-send-email 2.40.1 X-ClientProxiedBy: SG2PR01CA0155.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::35) To TY2PR02MB4479.apcprd02.prod.outlook.com (2603:1096:404:800e::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY2PR02MB4479:EE_|TY0PR02MB5621:EE_ X-MS-Office365-Filtering-Correlation-Id: 57826df0-0d76-4273-b075-08db723c12b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5DRZLKYtDHQNRX8tdkArPatWH72OR+KMOl6BLmFC8/KKmfrUT+wdYv/lGhyGVGywxwC0MTU13naWvMJdlPk5c0bbMPK1/86u1HtmA7hUeh/y4rN1GYK0sdwzHVl1nOZoYoYd2UcE/+/M7xPmShVIEudgslw6eJkx8ru1vM35Ts90bkTBWrof/fRUu8Fb04Jz0rt63cmZKqADF8ivqyiyQrzgmzXEcF//lATBSUEoOHL51WXC7Z3eb+ZecFtVEs7j2HCwRgL3fnQzjY31Bb/ce9pTEAeKK9OYK+7V/ceFWqqRvwU23qfYprO7W1PzEckunpNYi7tCsPPIkburUNFQZus3it0lhNVPJxIJ42H2um8aH8O+w7nqnxWjGyFhSZf0+Uw32/YU6WtKq1MpSBcBp4Vs49Y/kH56FHMz1oMR3tYkvh3X58w8ovhdO+qczo2uySxM/AYAYwgWSyp4B8qjYvlMsVVN+bDzzdFCU7Er0j2yqPKuwt2s0CtQyuzrB6sW3rRhmgtL4nrb0FgxHdHmBP52auknr7SlmhT2dnkiuwVkKf3oHXP+wBXXJ/UmV3891T9EESY/HhCkKhEOS39xcPP6M/QsKQJtma4MAbqCDArzGO54M2pvRG2JLNeaWRq3 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TY2PR02MB4479.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(376002)(39860400002)(346002)(136003)(396003)(451199021)(38350700002)(38100700002)(36756003)(86362001)(8676002)(66476007)(4326008)(66556008)(66946007)(316002)(41300700001)(26005)(1076003)(6486002)(107886003)(6512007)(6666004)(5660300002)(6506007)(8936002)(186003)(2616005)(15650500001)(2906002)(4744005)(478600001)(52116002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Nvf936NC4o8VZeq5/vYf3Gw3hlMnA660RwnlrlqQ/i87NZ1NMqXMi2iSAgBPtO1cubyorUHBPcjMrw95a8zZHv3UZcoOQqBaaIxcT0DKUskxODeCAe1wFqMLaB2X5vXbDVIdpKdVP5TlyI3L/t9Mxi3Z+M0hB0NLEyae2iqO/6sJBupqm2+FGDhQQhDF0Jzkvmh5j/kj2baDh52ojFLr5xXfyLXyV/UldNp212V+gTyLZddBh5FWkAFK5JrIP4faGb4ZrDagGux1Np9o5UO6QFxrS/CBg9HLHiraREsq9qrIHuZVyzJcwVyoQks+oupTXB3ZpCImC87p/ZLAKOOLrV4GFST4qrxIjg/qHICI58RJ7A8qhZKJQPoKEEY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5WgfaEEpNZCYoZyuRWQQFTjP3WlQGsr14JFQKNT794Jo0M5mvMG1LvqMvvqhPAPr8j3xj6wd9CfVhBAOqZ9Q0MRjVZLeQm9oL3MBjn84hELtQVMy936jG395h70OQ9X X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57826df0-0d76-4273-b075-08db723c12b9 X-MS-Exchange-CrossTenant-AuthSource: TY2PR02MB4479.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 09:44:14.3281 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5j4Koy1A4TDJCBUtRVEiM/JUGXTz/IBKf7iIABRmDcmgIapRBk5EG089XRURehRB26m6zHxEpMHHV9+c5uKv5Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB5621 X-Headers-End: 1qBuNz-00AWmH-Do Subject: [f2fs-dev] [PATCH 1/2 v2] f2fs: update mtime and ctime in move file range method 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: , X-Patchwork-Original-From: Yunlei He via Linux-f2fs-devel From: Yunlei He Reply-To: Yunlei He Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Mtime and ctime stay old value without update after move file range ioctl. This patch add time update. Signed-off-by: Yunlei He --- v2: -update both src and dst inode fs/f2fs/file.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index cb42d8464ad9..4adcf62e2665 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2884,8 +2884,22 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in, if (src != dst) f2fs_up_write(&F2FS_I(dst)->i_gc_rwsem[WRITE]); + out_src: f2fs_up_write(&F2FS_I(src)->i_gc_rwsem[WRITE]); + + if (!ret) { + src->i_mtime = src->i_ctime = current_time(src); + f2fs_mark_inode_dirty_sync(src, false); + + if (src != dst) { + dst->i_mtime = dst->i_ctime = current_time(dst); + f2fs_mark_inode_dirty_sync(dst, false); + } + + f2fs_update_time(F2FS_I_SB(src), REQ_TIME); + } + out_unlock: if (src != dst) inode_unlock(dst); From patchwork Wed Jun 21 09:43:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunlei He X-Patchwork-Id: 13287016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7E394EB64D8 for ; Wed, 21 Jun 2023 09:44:35 +0000 (UTC) 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.95) (envelope-from ) id 1qBuOA-0004Vv-6p; Wed, 21 Jun 2023 09:44:35 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qBuO5-0004Vd-W0 for linux-f2fs-devel@lists.sourceforge.net; Wed, 21 Jun 2023 09:44:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=61qsHPL9l+AXF2KqV6W2Ye3iAmr2tEYdR7s7KAdyGgY=; b=mh+BRas1cNJqpRr9NPIeWyKaF8 6SYlrEymdDi3BQNsos6qMWFtisY1hKubL90VRMAfzxadlknWJd5Zne/UiD6ZXhBr5LJQyQqvFSzx1 IMSU0FTpa78T2CuJ3pwCm1UV7LuSK0TrgrXLMg+H3CwfqKDqNw8CLgW2VPef/aZmsu3c=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=61qsHPL9l+AXF2KqV6W2Ye3iAmr2tEYdR7s7KAdyGgY=; b=WMpySfTIQhyRRAh5oimevTiY/n wzKiImxPJUoQeqpc7JYxnXSAzXi6BknwZ/a5XZYO42fYxEGdqgWWPLt6EYZ0dL+GU0EQGbdy7iN2E B/5HjG+WvYzWbBJ3L0WElny1SvLGN2j6yxrKHHs3SogMmWQ36o8dmOvZxi69S/q6OAJY=; Received: from mail-tyzapc01on2042.outbound.protection.outlook.com ([40.107.117.42] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qBuO6-00AWmH-9f for linux-f2fs-devel@lists.sourceforge.net; Wed, 21 Jun 2023 09:44:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NpOOxGN8adkzPYlNfA/PlnZ7AO9/10uqnR7B4Uah8n34YJgBtFnlp6jh4xlNh10YT+jevzBCCUHLVDeErvuh7Dpm1zBNQjqltmKRPwbbk5TNZGbUR76v1A8/sLdzWOHOgjPBXVL+1CXnDTWQ6eGt2OiAflmzTDVtSNC3Iv6JxGJWNuGQ2dKfBzqzhzYGqb3hKLp32/AYgBRGGwEiewjtBTO0vYVlTnltVmRpoMOWOtlR2WwJLx+v1I1Nuuu+ikh/tNBCxeDDcnOShpgRdJIMyxENA8FEHlj3og2XBTBF3ILX8k1Htsn8mm2RHjTNgNv1T69y3b3T0RAO/pbjinL6Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=61qsHPL9l+AXF2KqV6W2Ye3iAmr2tEYdR7s7KAdyGgY=; b=e9fFW6VCGjOY8kJkG2lzIYVosMDyrROOhQTexMQFbfUDF/uHkRFD6nhNF8IkZ/b5NxEoD7BquAeoHQBO7AjAlDwNl5jhFt2hrCQrXrLPkGOEDWqfF+ZyQ2pPs8CA9VN8o/DiebXb3GJsJNQYFSFTAww0ovth8nYkaXVcsNyN9cM7RGm+RoC2HUTM2AwJ5Kknb9i5vQaWV7Z4rBPhbLdwt01+QT+9stz/kV4X/4O1MwZL66ysRUxr0m9jF+zJBcoM1OSm8MnBCku4KTlMX1QWn5+Fp+60cdM+zJRDjqL+Wryrl1LmMyKWs8h3WtJn0WKxWMb/Tbcho43gEXOWp3jm5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=61qsHPL9l+AXF2KqV6W2Ye3iAmr2tEYdR7s7KAdyGgY=; b=mO0P2XWFa6rwhebzwTnqP8letWnaC7ryyTRVX6Z+XqOq3S8njCizY9Z8vZ7kBS1PjvStEdzsVWsGjdUGXlr9PBB3MUPnydmBMoeGmI1p5FpuRx5lrqG+6yHOSq40kuP2mp0isc+89EVmN/i0LIQAbFE1qutAlJDquJ49rRIjhFI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from TY2PR02MB4479.apcprd02.prod.outlook.com (2603:1096:404:800e::7) by TY0PR02MB5621.apcprd02.prod.outlook.com (2603:1096:400:1ba::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.21; Wed, 21 Jun 2023 09:44:15 +0000 Received: from TY2PR02MB4479.apcprd02.prod.outlook.com ([fe80::bc4a:4d7a:4c73:76eb]) by TY2PR02MB4479.apcprd02.prod.outlook.com ([fe80::bc4a:4d7a:4c73:76eb%4]) with mapi id 15.20.6521.020; Wed, 21 Jun 2023 09:44:15 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Wed, 21 Jun 2023 17:43:59 +0800 Message-Id: <20230621094359.3827832-2-heyunlei@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230621094359.3827832-1-heyunlei@oppo.com> References: <20230621094359.3827832-1-heyunlei@oppo.com> X-ClientProxiedBy: SG2PR01CA0155.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::35) To TY2PR02MB4479.apcprd02.prod.outlook.com (2603:1096:404:800e::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY2PR02MB4479:EE_|TY0PR02MB5621:EE_ X-MS-Office365-Filtering-Correlation-Id: e4481946-ce16-40af-8646-08db723c139e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: elEWdIjebv8DKt3mhr8EMms/vvIf/8BrMm6nlKdXyxGGk5YMnSILEDcbCetdOIYVw81nNi07yHxsssK4epcS/XuLkJnJhgx/qzmGL/YLKSEdqexKw7CIMeoaHZUGcWm28EFn9Asg0cUl5ZmMChdRj2kxz3pI1egvCODcqa609+vlr6xkClY2ZjQaosbqNAHQFlh+pWcs08DE1LgmQxWs6643TovVhMFbn+NYDda2l/PiFQjDQmOhHYT7OXBituhRG94ctyR8lNsq5wmOOQFtARwBayoMlPOP4v7e46GzZoLgGZpOHcEwdnmuXmCcuMyKjZIvkgDD4r/vpdG9UoihhuwRZSAC8r83UsEWWMoYzsoHVqqyFazuix+eOQc7J2xn/x1swcKXnY0bBJrpmutPBeWhnUFqSfN66yG4lj19c4BVbaFgmIZumvaaI7SO60GVGh1z97YAwMjl100o3Kj12f4VZPRrWnE8TQ1sFKHPHya0W2FTPowvMx38ZjT3SAASV9Ep6IOtnvnynQN0l6IjBzbR2tqvwgEFDd6YIEVHoUi5dl42MTxEMYl8vu3uYkmwdOskeyfSm0DrgcTmMgaWzpsZ+oAgzF4AFJ2IGkT1dJn0aCsAeYMhcp4qKb+AYhhA X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TY2PR02MB4479.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(376002)(39860400002)(346002)(136003)(396003)(451199021)(38350700002)(38100700002)(36756003)(86362001)(8676002)(66476007)(4326008)(66556008)(66946007)(316002)(41300700001)(26005)(1076003)(6486002)(107886003)(6512007)(6666004)(5660300002)(6506007)(8936002)(186003)(2616005)(2906002)(4744005)(478600001)(52116002)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-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JU7JLrFaOAOqVFbLS6RA5L8dWRImXi21yZEQdH0aT2n7ER4jpZV42X47fsdX2IA2JXaBjUJoeSNgQjapDjH6w19DQGY+FhHEzRRVbg45b5uMLGZM8uitJl25skX8/+n6+AK+wju1VFPlevynHcB/mHZscgXx13YSUfPzpk6i1eUaaVLRL6gwzLl1Y+kSbjf4VTaXQ5jqIG4555Va5dR9NVQwEBzk9UAlHoIaS+rm75YJE8DozgxYzycmADzImU6a7dQWCda769APtKdxfU+DdJkMKKIanOl/KPs8Dc427tjASO1FFJkCfhWo6nZEWUjrGokq/fPpKlvMVWEfTkovu0S1a/1G1K3GrSQkjDfY/4mS/fSTYMA4afbsaXv0h8cICYdcIlHeUxa+TUEU0FOGZmWsoGn8psnUeOY5neRCGzJF5/z/nc8uWxO3YQGKHKDhle35B2w7Kd7T8Q3reWlygd1eJKu28n7ZsnARyNbilHGhKIda/X42XiezvGu6x7oNp+0bVf1J5TG+FrTRxyeh/brtcXX1T84IhnRXwpAYhy09XtNr87vl8 X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4481946-ce16-40af-8646-08db723c139e X-MS-Exchange-CrossTenant-AuthSource: TY2PR02MB4479.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2023 09:44:15.7944 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5Lis4yQ9ZKKiyfoFLeKc9pe0Nl5DYhGRn5LHrR/hFXL1FA4FpXEQ7CglP+30gsEqJIBOef6REJ8wdti3EgB1MQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY0PR02MB5621 X-Headers-End: 1qBuO6-00AWmH-9f Subject: [f2fs-dev] [PATCH 2/2] f2fs: truncate pages if move file range success 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: , X-Patchwork-Original-From: Yunlei He via Linux-f2fs-devel From: Yunlei He Reply-To: Yunlei He Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net If move file range success, it should remove old data from src and dst page cache. Signed-off-by: Yunlei He Reviewed-by: Chao Yu --- fs/f2fs/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 4adcf62e2665..25ef36f2376a 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2897,6 +2897,9 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in, f2fs_mark_inode_dirty_sync(dst, false); } + truncate_pagecache_range(src, pos_in, pos_in + len - 1); + truncate_pagecache_range(dst, pos_out, pos_out + len - 1); + f2fs_update_time(F2FS_I_SB(src), REQ_TIME); }