Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3982333rdb; Thu, 28 Dec 2023 06:33:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFP7QDxcZUsomo8Oddj9DE39ixh3kPJhgHi6W2STsA/c2ONHqx2I0eWBJxGt9P6jR5GCrcz X-Received: by 2002:ac8:5886:0:b0:423:a2b3:49ae with SMTP id t6-20020ac85886000000b00423a2b349aemr18246323qta.18.1703773996432; Thu, 28 Dec 2023 06:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703773996; cv=none; d=google.com; s=arc-20160816; b=KjrjTlVT1qh+uhRPn2dBLUODlqZsKbbFT7sUqmZBgVYMrx++euje++ZDsLhAM5jgA8 l/YtZmXLIsKnSd67U+1ShNVrRg+86TVPRx/v0vv82RT98mRCl/PsNFkBzBpnSoiIxPjO 5DMHqsvcRvptbSAzwQfCZn0gt4RI9OrH/nwmxluzXoRsXHYTzSsVniKAWiQ7GBcTnThu l68nx4O6FWVPULLS+CGKOo0LZuGdHingS4zg8Zdg5zymcRfKuiq2qKu5fUZNw3H2y9m7 NS3xfqiN2ph/lYc/5uRs0UHtelO1IFHE62Wc2+XQuFWHlkFGseWZhZIOBVbcd0Gb+cGh +cug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=gbqBjB9dGO5DNoWz4hJSaL4wOc8782Hf6wNDj7ZMkLo=; fh=X1/oBJvTGJUQ0YtRp03u+3tPfRw/dXXALWynfOSlfQQ=; b=D4ViRjoworZK2RriLi2TQw2uZ37aEBBlAnTf7VSkfseuqxLg/vqPs41JhvxV56PM1b fjdhbW37/xLejByAOsbn15ItKnXqH0D6sO3AiTug56uL0tXNmyF4SUY7OHocKyyIyfxe NzAYI54zgtS6HigyDh9W5gKb0FFSjjORJc22HqoFRSYxljCLOfAJI5A9/w/0IoV1wZTb +M6KT+wTfMh0tFL3m8G6/OLx3jQrkNt3eQ13y4/HDxFLNx4DSSzWoPIWA1vHP1197QSR oNxXmrgOCdrb1I0EE9m6e1XdLM/VlUVaLuAxgdVAIUXe4iTchCsVTH84RM3153zttaAS V8EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fu+2B5Sq; spf=pass (google.com: domain of linux-kernel+bounces-12707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k3-20020ac85fc3000000b004254bfb3917si16843210qta.172.2023.12.28.06.33.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 06:33:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fu+2B5Sq; spf=pass (google.com: domain of linux-kernel+bounces-12707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 36DD51C21BD5 for ; Thu, 28 Dec 2023 14:33:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6CC4C1096C; Thu, 28 Dec 2023 14:32:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fu+2B5Sq" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5E5A10950 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 Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: [PATCH v3 5/6] f2fs: fix to remove unnecessary f2fs_bug_on() to avoid panic 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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) -- 2.40.1