From patchwork Thu Jun 22 16:16:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunlei He X-Patchwork-Id: 13289395 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 E985EEB64DA for ; Thu, 22 Jun 2023 16:17:58 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qCN0Q-0000vW-Es; Thu, 22 Jun 2023 16:17:58 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qCN0M-0000vM-7S for linux-f2fs-devel@lists.sourceforge.net; Thu, 22 Jun 2023 16:17:54 +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=JnIA4eGfMCYXEMlcFnq9u36R1p+VFdYmf3/BF4sqYzI=; b=EwQMJNHpMY+DvqulnjJ09hG7as yUkAG4iGLU08MzGSnFq1Wg14KMUBn/TrDvYCmIfCkuQMs6ttg7e4PrnrJVvmKlNEFyPS+A6KOhd1Q If9VIsM5b7Je4l3m2cvuiDl6YGbcEKO99XL6niWR17o/zx89/JnkHNlUdFNOOBcfjmq8=; 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=JnIA4eGfMCYXEMlcFnq9u36R1p+VFdYmf3/BF4sqYzI=; b=k 9leoYWZrA0ZNmA9gk6tj+qYZeWID1139z5nBPFjZ9cCjvVc/Oxz4uOHElGRsYWkX1kqTVim7RXZCS O8NWEyS8truo2LArtXyiaeT1LJv5sdO/L/323OFQtde8BaCGB0SK/uEcyyEfo35vWMZ/vvfEUbKNP R6R8Tp1M3nB3fYW0=; Received: from mail-tyzapc01on2074.outbound.protection.outlook.com ([40.107.117.74] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qCN0I-0000Ii-VQ for linux-f2fs-devel@lists.sourceforge.net; Thu, 22 Jun 2023 16:17:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a7DoH4PuAJLtDwTbp11kRv8xfcETVREmOFhmUl+g78UUWxPQ4Kv7D31tLlrMFvMekKZtMMdWO3c71yk4gL+bbMTxMLqzwPQEr5Ay9+gZ/+7guAk2fdUG+zpBJ8YgkTAHBytdI+u5N/11HyBgNhhc4RTrAMCA7UiTbbOuOBR6Sly9uXOqfsXSEACk2fgnTIiUMmyOplmNMKGhaoQeIIBKRvDPLhfu/PPxzOhFDk2OPfTdnJFvMRUcAEjv5VxbPm8uoPEBFEdje4iXCrzTH9/GbJGRWOVlsxp3apRy8byQNfWP67kFU/ekgixyPRtOgiDtBiLtFZ2wgRDCFhU7NLuRuw== 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=JnIA4eGfMCYXEMlcFnq9u36R1p+VFdYmf3/BF4sqYzI=; b=gNrA4AuacV2vEQ/Zd4FWjwDzYQhH5fzxixq8V3pRxywWhsvAUoWtl4gMFBOJhYc66VChGZlX7KeJXD7sMcIHxKwpTOwyPlc8GBHEv8nT3xfsBDorPO/260dr74tTputIfUejWKAcxT77/msMQggb9NfFBzDX5FYAYsZVcQuVAoz/krBEnIQ8aM6x6slkobHCzSYXhY8z5C21seK8AdgU0JH0q3WnGcadz6yFPh9KFwf9p7vRXj8q3KZLsHceEdDUo63uIYkZHH6TOKfUsq9Kq9p9DJOgO3wiOiX1HEjJD99yoiGo9jy+r7Dk1goHYpU8PESz1/ofmk1W6ewX7ZuZtQ== 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=JnIA4eGfMCYXEMlcFnq9u36R1p+VFdYmf3/BF4sqYzI=; b=hkELmVS48PWTcdT7ZC1X18JM/+AO+udsJWKQZuBYPoVIbT9p4hkJ+rUN8g679SDzFXf/JYVbhiJDz1sMG/MPpWU9/qVuyYICIPy9oYSSXdVnifMWLU/RDdzqrDBo2nVVMeljvXaBEwvWcKYwXUSwWLc4Qi6LE8sBJuQ0PLkv62U= 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 KL1PR02MB6189.apcprd02.prod.outlook.com (2603:1096:820:bd::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Thu, 22 Jun 2023 16:17:33 +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; Thu, 22 Jun 2023 16:17:32 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Fri, 23 Jun 2023 00:16:46 +0800 Message-Id: <20230622161647.742012-1-heyunlei@oppo.com> X-Mailer: git-send-email 2.40.1 X-ClientProxiedBy: SG2PR04CA0178.apcprd04.prod.outlook.com (2603:1096:4:14::16) To TY2PR02MB4479.apcprd02.prod.outlook.com (2603:1096:404:800e::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY2PR02MB4479:EE_|KL1PR02MB6189:EE_ X-MS-Office365-Filtering-Correlation-Id: a996395c-a53a-40dc-10c0-08db733c2e7d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NV8P1aPqqZ7W3CaKpdGUvXr6grTgOg3DPSQ+JRVvWF3F+3bAY3goFj29jpdVgn4bALsR7TExN03CtJxoXikOaCBhBUIOLaNLmrV3WYc1kueDTsA1j97HXuP24iEozCd1dFr+hO86YxUrS7217PyENz9ZunC6K8BZWsLqlSPB0WJgCFVNSoqklNb/rOzZpK7/2KwviNUK342lVS4WDy3JZdyfIXNfVMk8BDknl2uLAXdZslI9KohdvgwnqCEPRUF9RjtQGOOABxApY0R4pe7R3o26KLSpSRBWu8oepX0IUwiMl1x+fatW0OC69kPLSwzfDmduRIwN4HT3HqDXJMkPooxCfD/CN7nTNFgcYJOpaxslxA8/Tytt707RcN3jOYbRcb5Y3DBa28yUTnlMg655lsp3NLUmKfslbYTTqwikawgcYGHHYypzGwIPq3qG1La3hizptjFtHMEtxU2hQ7ap6Kha1quufnxkLQ3lsrB6QNRLKFnMTQwy4OkztsZWWHwsp3VYfh8bCWtXTayWHX3cvZ/KrwTTa9I8uwiKCnRyAcdtlvEfOdBvknm6CLHcwFBxKkleinRwRAp0Q9Y1UGvefwjpMieOlFSl/cy/mgfR2nE8b55Y4rqEViP6+v8+gtjf 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)(39860400002)(136003)(346002)(376002)(396003)(366004)(451199021)(5660300002)(478600001)(66476007)(66556008)(66946007)(52116002)(4326008)(6666004)(6486002)(316002)(36756003)(86362001)(2616005)(83380400001)(1076003)(26005)(6512007)(6506007)(186003)(38100700002)(107886003)(4744005)(8936002)(2906002)(8676002)(41300700001)(15650500001)(38350700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QHaSTlsaJVQ/P/ieDFpkaIlw1T4YKm9MaOBIFRUP7rxF2U1ZucIzaDfAlQ9d4vDdqDyg1xZC/C1Gvs1GiGXNyWeUzerf2FFpVlTrQkyxWVgma6DKKnTQImASrkMwN7Xgmayl3TiSR7s+DwNSMUYpUKEXAR9TI39abRrW/zp34olZCivJMHdxjPGTBiEu1AeKWmgcTfqLJ4+4oCunJjVDPnkaYPTZEUxqslFIw3ZGHS/iXi+1IJprDAS4nZ9knoMa9Xo36iaAXqyabr1FJXXJ6cUd7tHLutYf6vu7vfNsxS+L6LRbznem5spKT90KeeAEogv5JxhazwJBJvxBRCscGv9FYeemw+8uQkdbYzj0lY2n9HZSl0XDspa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7HRdRty1sYlmBMpytg0UazFOjmv9BWDaXhO+1TYK+lw9J4ohs1ef33k8L059vG/qbOD0roLC+CcuMJe3fJ4wTdbPb/MaF/PPosCW8FMOKN4tCfc8+bYCB3O6ZlB/Sn09MGux3J2P3cuyOxrJX+VUtYk4 X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a996395c-a53a-40dc-10c0-08db733c2e7d X-MS-Exchange-CrossTenant-AuthSource: TY2PR02MB4479.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 16:17:32.0384 (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: kOKcSgoPpX7h2FoRIuybf9PwlFUwwNu7b6Q9Gl4UotHJR05/RHbxTC9o7RK8VIxEyxRBz+HDPQCEpu1NdvWO5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR02MB6189 X-Headers-End: 1qCN0I-0000Ii-VQ 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 Reviewed-by: Chao Yu --- v2: -update both src and dst inode fs/f2fs/file.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index cb42d8464ad9..e59fc8faa035 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2886,6 +2886,19 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in, 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(sbi, REQ_TIME); + } + out_unlock: if (src != dst) inode_unlock(dst); From patchwork Thu Jun 22 16:16:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunlei He X-Patchwork-Id: 13289394 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 7CE62EB64DA for ; Thu, 22 Jun 2023 16:17:55 +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 1qCN0J-00017S-OM; Thu, 22 Jun 2023 16:17:52 +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 1qCN0H-00017L-PQ for linux-f2fs-devel@lists.sourceforge.net; Thu, 22 Jun 2023 16:17:50 +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=3SUgRU4Lh+anYyhlpU8OjM7HlytBsIPlTH83+HRomeE=; b=BnvzWdFz1CVeyazsPp9LB0EY2P 2/aLv3R7RKFvUtusd+dUukpH34bUffWOL6kPlpYRGWYbiLSjCr/nNqjFpcODYyjC4ngBcT9U+ie0u 8LqjOPdZY9giYaDdBB/D/hXWJlWo4IZLpYYuSEnRTqoPTQbQ2nuL31+zIv1TgEhG8iAk=; 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=3SUgRU4Lh+anYyhlpU8OjM7HlytBsIPlTH83+HRomeE=; b=CByrXmIkp3eONYS9V34N5g40DU +b8xW8R4TGBSqfGYxaKy4rq8+Gio/D3sFtgn7Y8/PFwbJFgTj/OV/dUxpHSa3Y93Wa+7znncjXCxg HdGz5Fr6xpuD2wwTxqeqNJ07/XWxOY7zOMlpQRtIGKbJ3os7uLogHI5L8f//yxyYfYXY=; Received: from mail-tyzapc01on2074.outbound.protection.outlook.com ([40.107.117.74] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qCN0A-0000Ii-Ua for linux-f2fs-devel@lists.sourceforge.net; Thu, 22 Jun 2023 16:17:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G762HZ/+Id5rxxfMLTugcntanCrNxIpER5uPcIb/5cZlG+N5wm9xwB7gABM/MtcpTcQmYm/uIyYXe2GU/iS2AwYHPGRpJ0VdYr/coJAm/pH5ovBZZfZJKfTrANVLiUFi1nznRBzly+4XjbdDiGTW1+lJmeczx5BMS9lO2NjZgPrQJN57QDhuB5YE0tGjkkNPjqS0Az/gLL16kQ4wKdsV0a+A1Eur5pkPaxqai1TMwI3zoo2gxgIOtObaEqA7afo2AJ3/pnqcZOXCPyiXxfhQgwxuV51waPjqlRvXrgWGwugGUIdeHL8+qOKKp+v3auVkT4gaVQpKafjnsoLNkOBQ7w== 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=3SUgRU4Lh+anYyhlpU8OjM7HlytBsIPlTH83+HRomeE=; b=mv8Diu3JV/WPT6gdYxowAKpglssKt7pGSq6PCxIqDp4wvHdWVzg9cbHlLjrqfg9JzdR2ZHpgxLyTWthfur4SCCziu2GQWfNaUFkGoC/gFt+pB2Ss5uAftGBsRREgth5O3oMzbA90mMnqwKQ3GNQezGrKpwPR1JnYWDe6R5/fJr+LCfT6boUDhysuGWkFK8FTAku2bdJoZj1HiL2uQXrOBTwMD2HG7to3yCI2newsnlhkRvXBZ4bSTUyG5RZVZrF0tbFL/4uJ3OFZzJPyFixg/D/BQ7zzo/5NhiEasYEsMsx62/BNtB04F86/2Ap7v57Mw/OsEe6QrYWdofiRDAAbrg== 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=3SUgRU4Lh+anYyhlpU8OjM7HlytBsIPlTH83+HRomeE=; b=tcYEI77D8qnqnsapdSNTebCZU1/JuJ0vf4Xa9CfVtPL2HTo+If4KFg9QiFNNwadR/R0yj8yPKbJkaX27ltulNNZAo8H+LLk6uOgXNt8gqlUpptRub/cmTUrSrgbjPU8+MHiDZNWCkBrZ8zmLS3XE1zTnGKoRUh3NKBStKSOLcJ8= 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 KL1PR02MB6189.apcprd02.prod.outlook.com (2603:1096:820:bd::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Thu, 22 Jun 2023 16:17:34 +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; Thu, 22 Jun 2023 16:17:33 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Fri, 23 Jun 2023 00:16:47 +0800 Message-Id: <20230622161647.742012-2-heyunlei@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230622161647.742012-1-heyunlei@oppo.com> References: <20230622161647.742012-1-heyunlei@oppo.com> X-ClientProxiedBy: SG2PR04CA0178.apcprd04.prod.outlook.com (2603:1096:4:14::16) To TY2PR02MB4479.apcprd02.prod.outlook.com (2603:1096:404:800e::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY2PR02MB4479:EE_|KL1PR02MB6189:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b25d98d-1dd3-41ea-acb8-08db733c2f66 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YjRuVNIbwUEhO5cbC1NuHcUuqeHE4woNXZT4umuyYUfuDIGk+RY5PV0hQnIECEfrRiSYqtrokGat+cf0qZ5Clh7LLeanfNfe2BXEqzNP2flmUR8wprGy0rhgC4v3eNhVpKGRD/I9MnlyisiWS6ZfdusimipcQnE0KMLC8/yKBCzluTFfmd/Ctn/e5KlktnDMp43gtOCKGbDxcofAFMzgVO3l+d/1jMk7ZwktS/h6/vW8p+2+l6+kWaqd03MyFW7Nruo2X3AlB43vISJk6CiJaMIowhMea+fRD9K8sCWI4YrZQfMd3BizNdUgVUtBF17puKimBJbVMraI2Qxb6XQSJ9PK726/oVlV+H/l5npZaXBp70P6Y6Mz/MySWzf5xr9WdgGLuxxTbtaRL1Xkeo0OmsjkAGcMCz1KkBsKXQZOe+1HVh2Cl6jFtmZCR+gkuSbme+WK8PAZD7lATitVGsgBFVcE2oYdURVrcBHtrMqDqi3UWvI4eRDW/qYDu7Wda0x3Pl7vxJ40Awppxf/ZicbFs6YwiMqdeQQB6BJ2nM6FKF3lXO0Z0ji9G1ty4ePXBWqOD1TXPObDc884Wmo2ZZb/0ilge7mpRKfv7zRdOeaGIyTYpe3flJpTl4YpXUhSKMEG 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)(39860400002)(136003)(346002)(376002)(396003)(366004)(451199021)(5660300002)(478600001)(66476007)(66556008)(66946007)(52116002)(4326008)(6666004)(6486002)(316002)(36756003)(86362001)(2616005)(83380400001)(1076003)(26005)(6512007)(6506007)(186003)(38100700002)(107886003)(4744005)(8936002)(2906002)(8676002)(41300700001)(38350700002); DIR:OUT; SFP:1101; X-MS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4t+i3SADjGD5osRE1UyfKlcjsXQxmu/yXMAq5GckYHaWd2ODFzoHHFQi4h77k0T2cuXW8SAydrxQc2+tGcZvdNp0atr6KCS1CR7w0jzJj+jf3E7FVcuaewTagokR0/iCps22r2OVEhWYTgV95rD/voYqHQ7CapeWi1xd12TSeW72GYi0h2+GG1ilNav7P2O5YW0wgRB7VSyp8v213Svwrgy6dT1xc0SrtI/u9aEMICEG5FjzLjLdJaXv6wcFMH4mF/WWpaTYrHvefzwZAJktqLgFV0Sat1vcHhv1etWUXor89RlCI301H6UM6m8xQCTZlxzsfsJtBejaQASzeFLKauQCF7zXRj4dJ4CvFuwVHcrBNNQSjW8bMIORd364/BoOP8cmW8yyWoIjV482k7XTfu0Ba9z4AUTjxUypqPtujHibW8D2x8+5jEpJB0hVmeEUGLnTRdgE45S6iDSCbrXXk8qWsGum2ukhMKjyvjhe3qwNrnp6n33KrDyJ/jcfHp35YtesTWQeE03b4czmPL++P3stWBF7NRCL/2bSbnXSiWkYF5pNjG/BymMncLFkP92yEfEeYV X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b25d98d-1dd3-41ea-acb8-08db733c2f66 X-MS-Exchange-CrossTenant-AuthSource: TY2PR02MB4479.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jun 2023 16:17:33.6088 (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: jkIoWyPlhfTrHhdg9pQaPNBPSuWA4phTy0Pr3W2UJ7lWC+q2wtEl+xlZyzA0Jw1U8fY2C1CElipPgD7NyTd0Rw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR02MB6189 X-Headers-End: 1qCN0A-0000Ii-Ua 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 e59fc8faa035..4bece7c56656 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2896,6 +2896,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(sbi, REQ_TIME); }