Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9087226rwd; Wed, 21 Jun 2023 02:53:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4waYhetYzMcpvQu2q0RSMSn6eS8x0s9zqAkJPK9zc3m2Tole/0vdwMX1zyTpzAFDe3+Hg6 X-Received: by 2002:a17:90a:ce94:b0:259:548b:d385 with SMTP id g20-20020a17090ace9400b00259548bd385mr13808963pju.3.1687341189811; Wed, 21 Jun 2023 02:53:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687341189; cv=pass; d=google.com; s=arc-20160816; b=mgGYnO1AIEOVPWuIZuO/g4OnE7hF1aGCxcSZN7YmNGvhX7wGLMLv4krtEuv2tO+ou4 Z73ZaB6UTetFenvmv9Jh6/PSmY5sImlyYsyc2NygdgXGs3uH0xq2ahQC0BUUpLnqIgKy WmTAxOwC1C7U49lXVtRVk3/auXS9IzBBEZ+Xoh9iF70ZXi2mzlxyc1ka2NBNX1qgt6kZ 9IHP3v3cBWC4/yAbLAhOGc3zbSWo0c2Ozfu0taycl9V7YihguChmqrdYQnqubAETNxfF eLuDZcBMECM3k5JbjylWfTeIBsUUn1YGxHNBZXb67J8wub0aaV7/N+PWcSshXSAU9gHE WLXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=61qsHPL9l+AXF2KqV6W2Ye3iAmr2tEYdR7s7KAdyGgY=; b=Ukc/PSmtPWE6n0R5syB1n/yfz0z7h3v3G9d4m15PP0uf2z/45ireRNNS+s9YhMDL9E EjUj/9YysJqQUW9FiMznw4FS3K7CZEMVT59xQx43OvzMVZzhRLmB3i6Du1jw73zFe1mP wFWx3klrPmUqWNfNTepKKeYlzYChQElybBbzMsiVxijqXwPe0FvkaMDYR5Afuzif/Bc0 cILcYnw1w6tScT+NEPnMSZXyMknCFwuHfw9LNJnwa2m6vMS0WJAZOcutJbPLjgceloBW v1QLVPnhnnEZijuiqUz96quO3cDwIE/pW7mEftDc4SV8ZC8jYuvSdRyXaRoxTUZrcZIw Mg8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oppo.com header.s=selector1 header.b=mO0P2XWF; arc=pass (i=1 spf=pass spfdomain=oppo.com dkim=pass dkdomain=oppo.com dmarc=pass fromdomain=oppo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oppo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mj15-20020a17090b368f00b00257482b1795si11490277pjb.166.2023.06.21.02.52.57; Wed, 21 Jun 2023 02:53:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oppo.com header.s=selector1 header.b=mO0P2XWF; arc=pass (i=1 spf=pass spfdomain=oppo.com dkim=pass dkdomain=oppo.com dmarc=pass fromdomain=oppo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oppo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231977AbjFUJo0 (ORCPT + 99 others); Wed, 21 Jun 2023 05:44:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbjFUJoV (ORCPT ); Wed, 21 Jun 2023 05:44:21 -0400 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2054.outbound.protection.outlook.com [40.107.117.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F638197 for ; Wed, 21 Jun 2023 02:44:20 -0700 (PDT) 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 From: Yunlei He To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Yunlei He Subject: [f2fs-dev][PATCH 2/2] f2fs: truncate pages if move file range success 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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?q/xOF+7Al0xrKJLbyqdi05RJYUvfUTJc2cKOXjWwI8k5xx64ozCH/7gnr2YI?= =?us-ascii?Q?AjhTVp5IlDY9I8AyT+GHkJVRx+ydWeI7ckHJYYgUkoCzFC38GWNeA03HZTxB?= =?us-ascii?Q?pKqQxdPMZ0ZE+z8d0kCI5SfTuLeLodNV0/ydWM1t439D80w1+8Fhpp8rW70g?= =?us-ascii?Q?QWFYCQbFy56zhaOSkYvhgd1u30kub87siIbvCrDtlsGPRT1iC4PA4GQwvfFv?= =?us-ascii?Q?BTJqyEAkK2Kt2Gf9UC9Xz3yZW+CTPaGUHYJinW8uAMGP3Cd8x4LzlEzC+e0l?= =?us-ascii?Q?DxbgGbz1Zd7PsY2zfmqr63PvzR5R8n30XCwBTrJXp4vNuFBaz1ZZ9pNv2lpr?= =?us-ascii?Q?8lAVJM2cmE6T+IjTWy0aKO8xqTm9Q7hdJKPAC8GM9vAO/WE81+olQf7oJHxO?= =?us-ascii?Q?Regy185H6Z3YZYFcj8thT+dYU6YWpI+kGo27cfGj19iFHLt9/L8tM4w3xIHF?= =?us-ascii?Q?duO4c4ltanHlS8jJs3spgfKfs5d2Hx80xo8T1PCkdxGnskovDXNNLf/MqHaV?= =?us-ascii?Q?pn5ow4iZ15Q0GTQ6hFMAiNGbolvbxUgRKiWpAH/zpebz51Rqvs3jzb3S+m6G?= =?us-ascii?Q?lpbMXlC/U6DbL6mTQurygpAHu9xnJXcye+T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nARyNbilHGhKIda/X42XiezvGu6x7oNp+0bVf1J5TG+F?= =?us-ascii?Q?rTRxyeh/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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If move file range success, it should remove old data from src and dst page cache. Signed-off-by: Yunlei He --- 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); } -- 2.40.1