From patchwork Mon Nov 11 08:50:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13870416 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 9D0A2D2E9C3 for ; Mon, 11 Nov 2024 08:52:09 +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 1tAQ9Y-0002yE-Fy; Mon, 11 Nov 2024 08:52:09 +0000 Received: from [172.30.29.66] (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 1tAQ9L-0002rR-1W for linux-f2fs-devel@lists.sourceforge.net; Mon, 11 Nov 2024 08:51:55 +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=c9ceKEwiR2MpS6zNV3Xg5/5F9h1yAOqNksCS3ez9i7g=; b=HElnwCwYTKg+ROMz1Ilzwy7ebq JQUNhp34TVqmK5gjZa1yaxSGGINfeYFAsq/v+EkzQe55I9S6Kkw5n1NJOf5UexDDAAWV2AN72tgF2 XyFSLe3kJU81ks0hQ2ZQe+jwDR9N6Y9mEReYuyBN6+GfpUMah7SWKgYhjj4ttvxFGvCs=; 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=c9ceKEwiR2MpS6zNV3Xg5/5F9h1yAOqNksCS3ez9i7g=; b=B j0pXH3smzfOt6XuV1Tn1No4uXDqRCfYKOnx2DsEBC7z5d8I0PSvZPMfRKcL9NmMPQGBvVmbG5QPWw O/Xp+kWTnIRyPgD/73TU/XYzVnm628TgvwAderwDwL3V/xLTfsZq7yOraTP34og1QRLD3Rkf7iU4j VGfraGNYxvzufM6k=; Received: from mail-eastasiaazon11010049.outbound.protection.outlook.com ([52.101.128.49] helo=HK2PR02CU002.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 1tAQ9H-00043C-TE for linux-f2fs-devel@lists.sourceforge.net; Mon, 11 Nov 2024 08:51:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aTF9hxE6qT7MWPwjN8AChQSEB3KbmCQVoR5O0IkzrKX439UaawXn+/BjNiOXFW1q4cBOFawlEwlONDwbRgwPIV/FCc9f/TMm+RIoeJ3Fn5ZH43iHVMD8s3ICo5+g+IH9ffJntaqfK1l8/kk5O4Y7VOo7lW7TzwfHxMaiw5iiPpLAQ57VLqAuy5D4KlfQ+rO6lNQEq61A7m1RnDw4HRYhO2COKcSc6rRWb45kRDhAvLItaw2bPrHTL9lzihyo9jQQqYg04OOgh5vZ4n33BIfHIXRuBV8Kx5Mo7CFayClZqfVEtfYM/JGe2Y4OYDia19QQ3/9iWVHcFVDOuyKGyyk2MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=c9ceKEwiR2MpS6zNV3Xg5/5F9h1yAOqNksCS3ez9i7g=; b=XNHyc1SptX6u1dzXdpP3a2bZ4587rlB28BmFx3OS41HbHj9y6Y2UwOP1SMTXZh1xFgMqpA2Bi0V8NNHmT9NTGAxjNVszk3wgACn4ER7ya8ly9S2nznIYgr/eNmkkqt9JRgDFiyoqswPPwoHR+UuaEOS+Vrkgj6BxwkJ4qdmvN6MjA+zwLWn9HGPq0XhRmB0zeeCw7B0CVLOx2ETIDs6NSPEo77/M0qBawHSrojQYhGOwBFLlNoxqLNoxLzEw2/EKMOOneDd0WshmT/Dvy2aMAcSxHexKkTPxcLNTn4zz9JcD9erGC0MLfBW55L9e6vdywj0jNzUOv9ghq24Qi2H7hQ== 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=c9ceKEwiR2MpS6zNV3Xg5/5F9h1yAOqNksCS3ez9i7g=; b=Ngv5jW1c+z2DL6VbGAOEo28+gMiqvQ1B8UBk/FqPSZbP9tK9asaAfnidGkHpJY4zOsmkY0UUqNjKF4EWxH3Grf2c7erkdB63G6uqLDGaRRuejCv038cNGwRq+ER3Bhf2kvfg36aAsPtdZDVnRW6wS+SHd8UFdnpbDCSC2YJXT0A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TYZPR02MB7393.apcprd02.prod.outlook.com (2603:1096:405:44::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.26; Mon, 11 Nov 2024 08:51:43 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8137.027; Mon, 11 Nov 2024 08:51:43 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Mon, 11 Nov 2024 16:50:57 +0800 Message-Id: <20241111085058.4136077-1-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 X-ClientProxiedBy: SI1PR02CA0011.apcprd02.prod.outlook.com (2603:1096:4:1f7::19) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TYZPR02MB7393:EE_ X-MS-Office365-Filtering-Correlation-Id: f63778bb-bf85-4438-afba-08dd022e10a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: 9ZRfVmHa+bhtYrrDVLxY+YusGuWh8wA4qKiXEoiN1XMgfz2vdafNPJAz+r+dBN7IjGRy3BCUia3gD4yFNLpFpS4jW97hJEqaUc80fqMe8Gn6Ew6MBWQ5cAvYavHaT0K0/MfPt5nfmTx20+/ocKS308adBtvpV5ZzbwslJd3tT/sTrT7onTgPFRwejdDmw1lu7cy0eLCFuHKfxFmC9r3lgOj6OOnnOb7K/2vYL/q84ErZ27xybTOU8/V4WKbde7jGP6tBmGDX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1GIGJOmzh08v/5LLtW3KRN/HYDyt13gx3dqBmF+b/wGMIukhWa4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9cym6LAFnVwboota+J/00CkG5e0gEJ/FOE6g3RXCdZXAlTLoyPphBV85XLZtCwsCYm7ZOwCwvho+fS6uh7+8f+OVcnxY8xtEKQjNEHeyHTH3HnZ8amgtKvA0BtI4XnWoeqJsznB7nVVViCmfSvxWpSbw/Ustrz/1ZK15x6bramNcSYxDa/yr7hKafrAYrXu4aJ5a6D3cKx9wOwDkLvXGvdYTUqvJLXL0lfcduQ6VMwZPFS44PkvVCklzcf4dZWoNJFMo/LSI5cNOvl3K1s/QzhKETcJN25wIo/H8puzY+IkRFboxWPpYuX0yXviY4OBKLpEeY4xah9AE+io8ruKJnrOvMo0pY50x1vC4JRhuhRnJDt+MMHXdIpaaKDHzLfJSWCSy6e130tFvgKgYXJLmfk4f+zVgnFRYCDjHUBuFRTgCu4na9gRrF3e73G3Ls5LCAiWHz/CLMayvIgNQvDTQzP2mcKRegYHoWBAaanDpA71ukuIvf9ruItr5ECdcn0/SJdA/7ZtXCPeASZnCA9KfdgHmjyEA4FktArS3uRF9YHXDWAItGJ9lYQjdBfp+ldGPkbaQcxNq/pcS6m5JTC+utsW1ddiC5CZwC4LkKND/8BaiU5TZoEBF/YDng7FdQByc+ok4ZxoIPAIBzpoVHvxjuTbpr1u/YCj/mCvtF1vbP/Wdd/Bff7s9FdjCDCfD0UbKNKUmQW9WPPjzPko6ndOU43eloZ1KNC2GZit3pc/gbVRSKX0odjTKhP++SY94aalJ4YJnSCDyFPTyY30r5bo7z4EhNWC9o+o6htwC/3VmGTfQzPMfesak902fgJxvxh6k/EBVgpREzkQvbuVrSSVaCusRs938AgGnpXPJFbU53Ez13GCC4gHtUMMttFqBrd0w8hW5GeyIvDRZ9XpeurIfwcArC5bv2Q9aqMfCwBCjLwFyBdFU6q4VIiHCuR9zmZjsHyuxPtXMNnRBEnMpKgDzGVodHb0QfOqiJH98r8USk/PcXmcQ3y5Lne7EnZF2DH2rBcBzCYUKOPpYUVRR1goQ8a21n5DuFbPJBCAaTKABllYOWTYyoXyMSmbk/t6hdtNIvJB2lHr59Xtoy4MS6HtAQSQfsLP3WCkvvuUAEyWwnzhsT4td69X9SEb6K3DLAuLlYf+fWWkSeUphPmlAR5Vcfo3yqNPokhG0GVZK9bjgf+jj0sh5gMZk85jTqpGSTJJHPskBJ4VGz9Uel7nSpqS+bl2DjxeNvj9vBT6aUQsDr5q2/oLQcXUOH9u4nc0WGvy38Y1euVRglxDNPr0vnlUuwGw0PfRns+7vMCMB6RdVhZEIyibW4kVrmTl0nIn0wQqMbKbMj0fphchp/6bPLtrWOAGJH04LHKoFo66KAjdL3G/+HYmDvIqZk41jDpJY1pnSGtWFGC5ldOvzYPNQdRPM7z0csQVLzqMc5eF/SD48mURkY3A0OxmqyzN6mfdc7E6OV1ZjUVMtodHhjOEroB4jdWeotHKpExgzTXfv5/LKbhUJ4XUEIuFc6rf26/n0H7RyKPVXVnCCoDT+zjw+0ueq6betIjGPIdpkHUD4Oc/Mw2A+UsS4X8c7MFueRxv2feEl X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f63778bb-bf85-4438-afba-08dd022e10a6 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 08:51:42.9961 (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: tqlRmc5mG3SAQBS3V6Vil1U0W0CBaQD/tD65+omZncb+WcGVb0aMFgFTziDe52k9487G3XM1tM+lr83tp85tCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR02MB7393 X-Headers-End: 1tAQ9H-00043C-TE Subject: [f2fs-dev] [PATCH 1/2] f2fs: fix changing cursegs if recovery fails on zoned device 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: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Fsync data recovery attempts to check and fix write pointer consistency of cursegs and all other zones. If the write pointers of cursegs are unaligned, cursegs are changed to new sections. If recovery fails, zone write pointers are still checked and fixed, but the latest checkpoint cannot be written back. Additionally, retry- mount skips recovery and rolls back to reuse the old cursegs whose zones are already finished. This can lead to unaligned write later. This patch addresses the issue by leaving writer pointers untouched if recovery fails. When retry-mount is performed, cursegs and other zones are checked and fixed after skipping recovery. Signed-off-by: Song Feng Signed-off-by: Yongpeng Yang Signed-off-by: Sheng Yong --- fs/f2fs/recovery.c | 2 +- fs/f2fs/super.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index e4d81b8705d1..324f948247ae 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -899,7 +899,7 @@ int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only) * and the f2fs is not read only, check and fix zoned block devices' * write pointer consistency. */ - if (f2fs_sb_has_blkzoned(sbi) && !f2fs_readonly(sbi->sb)) { + if (!err && f2fs_sb_has_blkzoned(sbi) && !f2fs_readonly(sbi->sb)) { int err2 = f2fs_fix_curseg_write_pointer(sbi); if (!err2) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 87ab5696bd48..42224c71ae20 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -4738,13 +4738,18 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) reset_checkpoint: /* * If the f2fs is not readonly and fsync data recovery succeeds, - * check zoned block devices' write pointer consistency. + * write pointer consistency of cursegs and other zones are already + * checked and fixed during recovery. However, if recovery fails, + * write pointers are left untouched, and retry-mount should check + * them here. */ - if (f2fs_sb_has_blkzoned(sbi) && !f2fs_readonly(sb)) { + if (skip_recovery && f2fs_sb_has_blkzoned(sbi) && !f2fs_readonly(sb)) { int err2; f2fs_notice(sbi, "Checking entire write pointers"); - err2 = f2fs_check_write_pointer(sbi); + err2 = f2fs_fix_curseg_write_pointer(sbi); + if (!err2) + err2 = f2fs_check_write_pointer(sbi); if (err2) err = err2; } From patchwork Mon Nov 11 08:50:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13870415 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 D7F7ED2E9C0 for ; Mon, 11 Nov 2024 08:51:59 +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 1tAQ9N-0003s1-It; Mon, 11 Nov 2024 08:51:57 +0000 Received: from [172.30.29.66] (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 1tAQ9M-0003ru-R9 for linux-f2fs-devel@lists.sourceforge.net; Mon, 11 Nov 2024 08:51:56 +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=gDc9TMGqj+jM3iAPfV5e8BYjhJJ6uyivPzzFrMvJmv4=; b=Uf/9qoNYK358PQJ5rfALKNlrZc sCXncVB4c0EUmm0c3/edf6t7225ccGgaxs4jrrT0XF/h10Yz/5f1QLaqcHnGI/Oq/apEBqKL2XcxS 9AcRVZLNUdBnEyoxPTO/sdZvl4NHE57cgEaP87YMwuVsltN5ur7iwEj2E5hk4Njypoi0=; 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=gDc9TMGqj+jM3iAPfV5e8BYjhJJ6uyivPzzFrMvJmv4=; b=cN8tLnSxMqemdRGtjw6zow9/Hv v5PMxvBo9WLBKlkEcRAXE4rq9S4TNjuPGcePq8yfMDK/yiIWCHKXbobMBxyYhdG5ZMUzXTDfoMyAg oxo/WUV+qBQYFzPzgv4n8t3Ww0YdvNaTIVn9K9zeeSGk6zuzignar7hcEpHVskDwFgIY=; Received: from mail-eastasiaazon11010049.outbound.protection.outlook.com ([52.101.128.49] helo=HK2PR02CU002.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 1tAQ9M-00043C-5y for linux-f2fs-devel@lists.sourceforge.net; Mon, 11 Nov 2024 08:51:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hlGMTv26N1DukiRkuFl1o9U6hHynLOYTiFlgftz7uu9Ohe6j7WQjTy6yeOoZBAIZBKKet4+szupQ3C2WkgWDieBqJibaSFmoqXiJzcRyXnhBIixH+/G5ZFLgql6yaOtTMiVf91ppNAoTJ/va/ELPv0xQEOvX8pOZNqSv+R9Da4V0fbdvwkXpeMeshsdYowHB156/DOFn3Lgnib52hFm5hGJuW5whSWni7Mfxkwmvu1raw3jmeonCWinKMGgLzyalKHu+WxovZwfUTfdAnuCywrtP6xpw5//QSfLtlCA21/9AaD2oXd5XODcCEt12vyNJXh9fHK5waQc/ytIxv31e0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=gDc9TMGqj+jM3iAPfV5e8BYjhJJ6uyivPzzFrMvJmv4=; b=VF1NQi8NLxIUfXy+Lclk+nEVrBQz0uaKB05A3bOqmKG48xEF15MchR3o7F6d13E7yjIdy3s0MZbmnIxsTA7WGfTlNqeiVWT2PAe/+zBQM2nJQlomEC34rPuearVu80Z9OYooXE+Tibq31PQwwjduCJiMaj3SN6zy4s6sPlSV44ZTpVSERhtFqAAnnUB5fBbPOtdMBXvsyjW09T1NCBa6DU+5QmhPpqT63HZNY/qo4/w/fddajLK0Dl/LaMs0rFurQNcX2V6Rzv8LilYHUyUXyZF2kxEwlNwlm3Q5CgTplxxJ+U+H5o6cbgvtm9x+7T0ciKQC8gk0lk4VUPflEC/YEg== 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=gDc9TMGqj+jM3iAPfV5e8BYjhJJ6uyivPzzFrMvJmv4=; b=udCEJqrp6SXrSwIB/iSfpEAWLLYzAjQhLskuST1mtks3vjK/H6AaFsIGya4N0mbafDo4UpG2xWU9/SVraJQI9GPllUSI6VvYsf+tlk0Ql8Vmp/U7mLqWCM+jtzgBGDlEpkX8xXZhC3Q4r7H8RjBe+NFHbBWkebJAyianpVmnZAI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) by TYZPR02MB7393.apcprd02.prod.outlook.com (2603:1096:405:44::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.26; Mon, 11 Nov 2024 08:51:51 +0000 Received: from SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796]) by SEYPR02MB6014.apcprd02.prod.outlook.com ([fe80::bb06:c283:a50:7796%7]) with mapi id 15.20.8137.027; Mon, 11 Nov 2024 08:51:51 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Mon, 11 Nov 2024 16:50:58 +0800 Message-Id: <20241111085058.4136077-2-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241111085058.4136077-1-shengyong@oppo.com> References: <20241111085058.4136077-1-shengyong@oppo.com> X-ClientProxiedBy: SI1PR02CA0011.apcprd02.prod.outlook.com (2603:1096:4:1f7::19) To SEYPR02MB6014.apcprd02.prod.outlook.com (2603:1096:101:6b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEYPR02MB6014:EE_|TYZPR02MB7393:EE_ X-MS-Office365-Filtering-Correlation-Id: 2441200c-3616-4e13-163e-08dd022e1560 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: 3CCmO/MHuaDsoC6b8RXD2zCGeQuHNp5+pt0VMdbne7LUC8zCmTxbvoXtld5gZR7NRirmPcnDPd5/TV/uTiyo2l/H1gTJGrfk96zUo63tZzK2cWukFUhH9nwPm1KZg80HK6mP5Wnkh7R3CBCEfmkqYbl+n646Cf8+AsrbEDKwokVxzyxvdNJTZi5jolcXkTnIAT1CSiIX/0NxvYWIILmw+N5BA+hjwO1J3TH8qy+zmfh96sSfAbYc4GusoMfIHm5uv3BPYIFxBIadR957N5N9d0I6AF2IsIixWvulaVXQqV9lL2b0rckwXiWQNs+p7l3fcLkda1YcqE7yT7xOyhCD44/ib3kQCV7+OjeQ7wBC9GAeCQEFG1/dgoI0MTdI2Uk9b/+qc/mnpojr5e/Af+2N0UMloizEP+h7ZYq/hhEzOlEd/JEUyyVxznvLXi1zxFGYPj0O7MT2UkCXlAhFlan+YoLGV8epTZ2/tyY1tl8csEbjKwtfM5AdFhVgfrJZr/jufv4HQMSqmGo8RSI0dOtpuFE7oAkRBgAPztR7LyX/3NFdIpB26w5cuBmf4HnHNaCWLBtBCrGeNqpHRc+gCjwSi5ZaaJUdMp9wxLxPANMJtscpI0+aCH6FZi2JnxIKvLWInhjkM9j9BUyopxKdZq1anywcsEW0U21xWB6gpglcAznupehZO79PLO5JKuTSxyCr6riXgUFabFEHru6r1BW0kAt7yQo3bd05oDWpn8YFBSyVANDA5Wlbw0sMiLFQis6gY1mMCJs2XMKOD2VmtaDvhKQZDZbnqORy8jE5MEvyeZARU6mJkSi5bA/6RNcfp0nfXD4y/GuuKS93FA1ZOgD2PcvRyCcDj/AnuWyYa5miFnkEkI49RH+ftjLndFX9w5JDVBgrLqfZK2zUomofJYF0bPo5NwmpAhvJDWtnfWOHRZi6QAcbrP5/RWUIZNh8ToNlwFhdUTrqacB5mCiQmWxecFwttbe7355S+IVAB34IjqqvX2votNlGVioQRw6oqgs4RKs/a5+OjEEWGqgoxDLjhJVj+kieuxYxWekHzUfoCgqF7G5Izi4oGO8M/xlb7JfKK3uNE/nFKjy32Jhx86Xr5BdaU8QmXj4bZrnFHgb2Q/957/Gsf2ktafHpMB7VKrZ3DqYo+62fmVXSsSXKEpED+E5vITapfalh4zPjFbeyg+qxJjzj6kNMnEhe9AmqPqvFD2FPUf6kdt1HSRGDxXWnoRDPr/+eCtw1hgNozrtvbATxruVvMZUxH+2ioyQGuJ6ESMi86KJvMCjYX7akIAy1qFfdSfETCf3u9+qt/aD319NYpV9eLp/m6Ej80E2JxCRUW/ewatVBf/3P6OyO21abBgfqq5iBBht5M51gm9PTcg0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEYPR02MB6014.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7hgBik2bP1X4YYg6pYeyq27Gyl92ufjIsuFApEyuQWS52wNEscvpF1feQ4izhpXO+/G8Hb28QlVmfYv+NYy6jjmu+hZo1yWzatHs3SeCw+Awj5nXh9FA3lKR2AQVOuAYSs10+bWY9in4T7l7OXFCxwg3PJtfszoNmNeM5dXAPvdLl1QoxcjlGjlNx42xNIiGguuZiBkQtDsdscZ8btdJQyCFgbviKeswpxoYWRc4PmmpJb/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bICIzqhJz/XJ48m00zWiIo5KS1QMKJzhH3Q2pgK7WP70K1REF+F0CsWOnVdx+Es6A0WT1KbCt55W2HZAGnJh/QvbqJ3v5nQXjDkgW2tW8NklYc5BNk7S7OZ3euuhsf9Rj+p7HpK8kusnaJVyZEsHkiW+HDynvk2YfcsLYtFIVVo7Ww0XRHp223ru5v1CZdAxN6bUsRgIcH/QQsEkNAUFHQay6ElkNj093OBYuqTuFRtVUti2hH/Jf6Grsn6L4e83geNtiKMoAKiU83 X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2441200c-3616-4e13-163e-08dd022e1560 X-MS-Exchange-CrossTenant-AuthSource: SEYPR02MB6014.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 08:51:50.9183 (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: tE6ZC4yJ+6u75R3hCovFS4V4ApjcW4J7pk4VXRtrDF/48amrIDhXmodOwnfO3em8FiwSV6CvGKkhbQqmH7uboA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR02MB7393 X-Headers-End: 1tAQ9M-00043C-5y Subject: [f2fs-dev] [PATCH 2/2] f2fs: clear SBI_POR_DOING before initing inmem curseg 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: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net SBI_POR_DOING can be cleared after recovery is completed, so that changes made before recovery can be persistent, and subsequent errors can be recorded into cp/sb. Signed-off-by: Song Feng Signed-off-by: Yongpeng Yang Signed-off-by: Sheng Yong Reviewed-by: Chao Yu --- fs/f2fs/super.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 42224c71ae20..92e93899c033 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -4756,13 +4756,13 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) if (err) goto free_meta; + /* f2fs_recover_fsync_data() cleared this already */ + clear_sbi_flag(sbi, SBI_POR_DOING); + err = f2fs_init_inmem_curseg(sbi); if (err) goto sync_free_meta; - /* f2fs_recover_fsync_data() cleared this already */ - clear_sbi_flag(sbi, SBI_POR_DOING); - if (test_opt(sbi, DISABLE_CHECKPOINT)) { err = f2fs_disable_checkpoint(sbi); if (err)