From patchwork Mon Oct 21 02:31:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LongPing Wei X-Patchwork-Id: 13843499 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 71E65D3C92F for ; Mon, 21 Oct 2024 02:32:31 +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 1t2iDc-0007uv-PV; Mon, 21 Oct 2024 02:32:29 +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 1t2iDa-0007uo-Tw for linux-f2fs-devel@lists.sourceforge.net; Mon, 21 Oct 2024 02:32:27 +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=YDYKhxqjgazH2uOevqpNxewM/4Xh1F1Sf9226Kc5nOM=; b=ZM1XbgYyWOlJYlnXwX8nh2EIdr FDlGwaFcogByWIlDH9F97pWpeEw9oIFXS7WHgFP4+VC7vTnFi07Q9eAnhjbH3m2DsxUKIdLbU4mGq rfnlNP/MQADod4YeqDSulCiQqzpVRL+8q+S3JnBEOit+sfyW26VSLEJCzBYqfCaGUNjw=; 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=YDYKhxqjgazH2uOevqpNxewM/4Xh1F1Sf9226Kc5nOM=; b=m kYvQ8nageEbwtonu8ZcLiJuCZb7grJUkbpd7sarc6cJOm+2IOZtSv5tJTB/J1ko7EPpjt7hPgJ6A+ sxdsmmRDWcoEw1QbR1U0xEoTg6c5btiBp49M7RH3MjcLqP72vuWNylZC3rMZfJJ96jcXtyC5JpEwp wZdPSm9RgWOR/UcQ=; Received: from mail-koreacentralazon11013008.outbound.protection.outlook.com ([40.107.44.8] helo=SEYPR02CU001.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 1t2iDa-0007oU-Qj for linux-f2fs-devel@lists.sourceforge.net; Mon, 21 Oct 2024 02:32:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O2Me922V1xsv6naNoC40JK6Gi4wVUUWdIKk/af1jMmcZkL3FcdYWAlU47gCqIF+5x9KlxNXl5yHxgR0g+b/Z3QttXJuIZDLkBOZ82Kyw788SZIeXuyF7IzRSuEnVQjXK18FNYCTILx/0hvp45fFJNvDfdyyrQWZ7zzj7oKIOXGEzBFw0ZuWcdcMQAJwK753qbxNSmFGkRpp9eVYtD7bshtYeMmNOOshrejiaqUOmD13R1AKj8yBv6GIt1Bv4AgjJuEZYuoIfsxlMlWA4UDGp0NLxw0tEMNIhnrB5Ba2FGiD8405jj6rzyg/Jmf15UHY95yh31P23D9r7SdAOFbBnyw== 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=YDYKhxqjgazH2uOevqpNxewM/4Xh1F1Sf9226Kc5nOM=; b=zWJKaDMsdaxW2T7QoSyuhYM/7oObE6Tbwc0dmVSAiadhqC9L5Ri+XCopg1QDF4whAEbLbe66s+ihu07TYRf0U2OSbHZ57PD4wZu2eJS5wrAnOwydt4i75MsBpfeXw3bUorI0ZVQ76HfI2zziQim0OBmb21GBgUJ1Dru9gHCT61B29Fp55f+Yvtj3nl4vAwLXt3C3+VcaebEw0ivsyVIK5/h1f21xwUUVfmwR+MX5kcU83NIc+EweU6XDjcGnqSBVeN7lJQs4LeM5X3pWI35NHYDc0CTMZdpl6xEdJwFDaS9O4rliHpa01zVgiL/KpPAg4F4Qpwgunrvg9hW34BWTkw== 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=YDYKhxqjgazH2uOevqpNxewM/4Xh1F1Sf9226Kc5nOM=; b=RowQQd7RhTxqgswbM7awxFTR1je/AYnsbJ932asaI/l4ZDdJMtvS9UjmKXPYRv3hwiqSSFKgd26QsaUEIMLskUGvfoHWBdDivt2T+EB8kbcpxQ6Rz1WZa+aGQtruRyK/Hq18II80EB1rjzMGMxtJFYstsNg8PcYvD7A9/E9wjx0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEZPR02MB7967.apcprd02.prod.outlook.com (2603:1096:101:22a::14) by TYZPR02MB5691.apcprd02.prod.outlook.com (2603:1096:400:1c1::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.26; Mon, 21 Oct 2024 02:32:18 +0000 Received: from SEZPR02MB7967.apcprd02.prod.outlook.com ([fe80::5723:5b88:ed4c:d49b]) by SEZPR02MB7967.apcprd02.prod.outlook.com ([fe80::5723:5b88:ed4c:d49b%3]) with mapi id 15.20.8069.027; Mon, 21 Oct 2024 02:32:18 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Mon, 21 Oct 2024 10:31:47 +0800 Message-Id: <20241021023147.1774412-1-weilongping@oppo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR06CA0212.apcprd06.prod.outlook.com (2603:1096:4:68::20) To SEZPR02MB7967.apcprd02.prod.outlook.com (2603:1096:101:22a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR02MB7967:EE_|TYZPR02MB5691:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e89cc54-411b-416f-eae8-08dcf17894fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: c5zGQSuF77qvT1baCtafphM29OEvAvcLU6slfIhBplwMLQ1AVV65+r3elQCELW7lyhjrEjz2ttxKuQe/ihgtTnViENXdhpMiX7jD+XC98W9Y9kMl/qY+4vcvHrWafJ+4r8abHphHA0oTNZSobElBsxdtbU0Ysj7KOPWGVrViGpHaZ6LTIz+PILx9kQ6jOjJ0ww3RXaGQ2YeXdDqCkVtQO0jM4aVmsYKfb6zWv7DJtEv+Yyrtnly8OkS8Fd4pbS6tmdc3qpEaU+H3BHCR4N46fIQXNkfTT9QYNZ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teqCESPo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR02MB7967.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(376014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0L3BfgKvB2ocNEc0f5A5rK4GJy2fNXifVzwgBej3FUR/dYr/xmcqpaHaX7770y5JcNNSvVPh947RI1FcVUj8dU8OY37p73442AWJ0dJnnKfxS63WAEHlnKHiQl+MeEdSs8e7NZcnPBL0i/Bgz/uD88LaiSdPOaGwzzhcW6e3O7bAOBdUAkPS9gJkjTXus8As94CXQGbcjELXoHKWryA/PG2Lkf3cy53nXc2EdvzkIaOncD7D9/8JzNd4mBPYaZzVjzYk6gGWyptpfUFo/eyv/Ai6KOSxPMvyNPwgkn5ghZOXRjtzLnkiFQcRJZjFL1KmHrDHAY4lE67MNteFPPUUnudo0xqOL5X3O6RnBxJH18kUtvqxr3SVJVAANeBNfk6QXVLweYtEWrVtdj5M5zGparY6e77K3DhQyI6q5/AHEDVEFiDpb7NbZHQcq9OCg2LAWFqfg7u+7B+xjCx5VSd8AOCX637lJrrsen9NvbgW+w/qjB4hBCBgFyhLcS0ckQ3RUem3n7BuBMBHBLwwGzc9KXCI62W7dyqHMVB098ZXX2oS1KEQPjYLvRQJ9VPU8JA/zNZS+I2A71WLle3N0Y8qi8asUlQ8+1viM83CtZWQG/CaIZfC3mI9Lc46rIMVo42HUgd/g495qLCLnznqYM9Pa/K26ZZZhHWdzjFHBe4ZdQxzZyfDf2e7FmwGx9j2pG5V+3x9Ta5WL2NIMcyBiujcbV4CmxBlBFyaudAz3Ax6hE6LH9prELfmqL7nWpPcL5H54Y5Ii7ywMT+Df5NAL5qzNjQBMrqaZhUPXieGalXkpNuvW2iZscpodCML3+nmk8hSlh0G20m1OcwmFla0h+BeNOFCR/At7v7IZ8aRaytxoTSJzB1zKudotgQqiR0j5Un3rMNr3MawCfDMXDLnuyXntMg09YQnmMlzgoxf8ZmU1jXTPCe9SMRHdySVYWztnc4sk9C4uF2iqJ7o+aTBC4e0AyMlS1aX9iS+k/0kLInZdyLR8J4SZBmbbmgjdZoxve+LnCCBQFLeoHc4RzeEqC4MY0rpRWPHwOVfpmmZlpikeOgLZ9z+H00w65pEEtApHezSAAgq3lRlah3BsMEDqx3s9PILGz2Nv5DjfqQP/+ygYwXEZA2lLGJtRg/hiQ9HW6y8hsQuF7/1bw0kT5Of147nyHyLmwWmqia64qtp6th4SbXC7PnxrIiXvPHtmP9SJclZCpcb0++gNFS6kHC/R9ZjrEuo+klbLvPxSOqHtyjRlg8etxGIlIv8e6erqu+In6SRKaFCJ4oiK/go6KA3AbGHnfQ2d6jOXuyxW1VxqTznZzFY4GGsl8RCjGFDEIdF/vYlzLPN+x/gzOKDB44dZWa1GESAku1XaUPf1MlgJmTHg7rLBSuH33G5IjEZw9pre06vKnGQL9lxLmjX1ANiu2lM7Jt7ZZiwqB3zsaLi/w6sjBBsHsO05DLsax7WvpaMIrs7VhiaFUK5qzQucgUoB0aZPKNyZ9WTDzX1/amCaiPKD1CiTI9cEfsadSULQ34e93ein3tWd7jGA8+7uQmYv+3fWH0ozo4zXCJzhAN60TSIHO844bG6VS3msuXoXieBijtFU6yVWd+w8L+Y4DKsb5hjzA== X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e89cc54-411b-416f-eae8-08dcf17894fc X-MS-Exchange-CrossTenant-AuthSource: SEZPR02MB7967.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 02:32:18.0582 (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: eQMrwBdk5ubLWSS+VZrarpCvlgBqTj/cnUqfD7lJJYE/B5KRmZoFPSm/V7gquNu2RxE74SYD33A0b9FSqDBA9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR02MB5691 X-Headers-End: 1t2iDa-0007oU-Qj Subject: [f2fs-dev] [PATCH v2] f2fs: fix the wrong f2fs_bug_on condition in f2fs_do_replace_block 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: LongPing Wei via Linux-f2fs-devel From: LongPing Wei Reply-To: LongPing Wei Cc: LongPing Wei , linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This f2fs_bug_on was introduced by commit 2c1905042c8c ("f2fs: check segment type in __f2fs_replace_block") when there were only 6 curseg types. After commit d0b9e42ab615 ("f2fs: introduce inmem curseg") was introduced, the condition should be changed to checking curseg->seg_type. Fixes: d0b9e42ab615 ("f2fs: introduce inmem curseg") Signed-off-by: LongPing Wei Reviewed-by: Chao Yu --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 1766254279d2..7b54b1851d34 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3977,8 +3977,8 @@ void f2fs_do_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, } } - f2fs_bug_on(sbi, !IS_DATASEG(type)); curseg = CURSEG_I(sbi, type); + f2fs_bug_on(sbi, !IS_DATASEG(curseg->seg_type)); mutex_lock(&curseg->curseg_mutex); down_write(&sit_i->sentry_lock);