From patchwork Thu Dec 28 14:31:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 13506084 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 48626C47072 for ; Thu, 28 Dec 2023 14:32:32 +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 1rIrR1-0000q1-Ae; Thu, 28 Dec 2023 14:32:31 +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 1rIrQv-0000pY-5D for linux-f2fs-devel@lists.sourceforge.net; Thu, 28 Dec 2023 14:32:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: 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=gbqBjB9dGO5DNoWz4hJSaL4wOc8782Hf6wNDj7ZMkLo=; b=K8Z5IriwMzHDDZrN9KW9H2KMk7 GN8OLCV9/j5lTdaXn75vAg49ZUBmqt6bu580GgqIGVyE5JRnATWCi1bAp8sca/YuYncnNLtWl/hr6 rNUtgTIlZ2QinG2hzyu8ZF9lqndhZdFnKQMjL6Lw+5nV5Cwo3J5e2hEUpoyekZVNB6JI=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=gbqBjB9dGO5DNoWz4hJSaL4wOc8782Hf6wNDj7ZMkLo=; b=Kt9APBaiLBPexKRlJu15syO8R2 gp86MAYG2MMt3PqHnJTQiEHPyIr8H8FamBSs6HlnznsDFe+av8dDa9bXkbQujq8kUc52acWUzWxBt 4cOEfWR/Y7lF97mAwalroISwrtOT67z51/vUAMCfm6NLP8G0vUz6dqMYJ72ANu5Uxpuo=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rIrQt-0000zh-SX for linux-f2fs-devel@lists.sourceforge.net; Thu, 28 Dec 2023 14:32:25 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5B7EB6108A for ; Thu, 28 Dec 2023 14:32:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE7F4C433CB; Thu, 28 Dec 2023 14:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703773932; bh=gbX4YWfRwjVnF49sDXj1O3cCSmmOzMm5S1M/X7oiEXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fu+2B5Sq02Xg1h4uTwh2tBRcfPL99jE72HLiZkQA49ZS7hwV6im12C6h5G2Ztxyy6 /AXp5YbuBLvEPyB7GOrM47fnIZlPSkhMDvC5DJDl6G9a08tlDRY3q5tNWfS2WSp2FH vhP+0obirrQqsexCUkyd7/cNLNKzH636PdPyjQuklPqa9kvQobqAgrCKViaUXAiz3l LW9Y1qbs2ns/qqTz2KJCZD2WuUq+C035C7jB/6hRLyZb8z7ynQFSONQSXZXpGFWXqN qzI155cPbVZHwPcwKVmpPvPH+R8Lhd56vrQKUzrrfm+Yrn1LBWhyUVwLmIoqWTTrm0 pPxC0ghvG1XxA== From: Chao Yu To: jaegeuk@kernel.org Date: Thu, 28 Dec 2023 22:31:51 +0800 Message-Id: <20231228143152.1543509-5-chao@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231228143152.1543509-1-chao@kernel.org> References: <20231228143152.1543509-1-chao@kernel.org> MIME-Version: 1.0 X-Headers-End: 1rIrQt-0000zh-SX Subject: [f2fs-dev] [PATCH v3 5/6] f2fs: fix to remove unnecessary f2fs_bug_on() to avoid panic 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: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net verify_blkaddr() will trigger panic once we inject fault into f2fs_is_valid_blkaddr(), fix to remove this unnecessary f2fs_bug_on(). Fixes: 18792e64c86d ("f2fs: support fault injection for f2fs_is_valid_blkaddr()") Signed-off-by: Chao Yu --- fs/f2fs/f2fs.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 69e71460a950..ab710bb6d8b3 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3470,11 +3470,9 @@ bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi, static inline void verify_blkaddr(struct f2fs_sb_info *sbi, block_t blkaddr, int type) { - if (!f2fs_is_valid_blkaddr(sbi, blkaddr, type)) { + if (!f2fs_is_valid_blkaddr(sbi, blkaddr, type)) f2fs_err(sbi, "invalid blkaddr: %u, type: %d, run fsck to fix.", blkaddr, type); - f2fs_bug_on(sbi, 1); - } } static inline bool __is_valid_data_blkaddr(block_t blkaddr)