Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1458401rdd; Wed, 10 Jan 2024 22:43:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/6cq2ZXgnIq5DyQS10Mfpuc/769U4PwD+0GBKglhxiEHDkcUXpmKP5IHa6R21M7rFf63w X-Received: by 2002:ac8:5907:0:b0:429:9e61:990e with SMTP id 7-20020ac85907000000b004299e61990emr218359qty.103.1704955402604; Wed, 10 Jan 2024 22:43:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704955402; cv=none; d=google.com; s=arc-20160816; b=OSd2ueU10MusRI8gTw/uSc7fh9aTdOfg2fgT3rVaUvPmATC9SZHCpAAMGnIqawa3fv AosnwHNop08dpbApWCDF+vKbvsakCwd59UbRFsfIL3xkIYQpLvl9l0ZOVSUG/PN0j0om u1nVfVxvyusrkSR803wS37Ar8h9mURUoFsA0/kujiifkSARFtkdncDQJfBs7vkU8gGuK 2bHFPFrkFgfdxY+wT9sBLrIv2b1PS3lrNEJHwkfa6rUUPSpfwLG5osrvcHwSmaF/jQlZ mfWbNMRnqEjxQuN5FD337hGQFbBluSHMncM1bniu+sLnYv7L9xHHtpdcuJdVkT3My2kg b03w== 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=xXo+B1mQLdOm5SD5V6WJBCV7G6BD+xyZvvqFLFQlMtHEAhcRj3bADuNjFk63ECQBwY vgRXaYiU3E7Vhk31olpaLhqe+FQ7vgWyb2/zb+am9kCMiw1SItvP1Iu9Zb6cnhMMiR/z Jc/24Kt9gF3JkpuoWB+ac8j9O27X78i9TDNm6ABNlifRkACBQ+3Qzeb568CPvgLhmgiD jxAawhwwyHhBl2HW+jDbC8gZW7vXxikR5M4fyBdTxJ+fxmZVNdFlp0n42Ibz1jF4tAYj USqjqJDI4EP4UevmmHAL9GK97aYsxeU5nYvnhJ2BVqgxxQEz9Uepentj3ut6duHy21W4 ESmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GB1XxKtK; spf=pass (google.com: domain of linux-kernel+bounces-23108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23108-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. [147.75.199.223]) by mx.google.com with ESMTPS id r12-20020ac85c8c000000b00429bc06ecc1si367183qta.724.2024.01.10.22.43.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 22:43:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GB1XxKtK; spf=pass (google.com: domain of linux-kernel+bounces-23108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23108-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 5EB5C1C24C1A for ; Thu, 11 Jan 2024 06:43:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D6433D287; Thu, 11 Jan 2024 06:42:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GB1XxKtK" 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 17CA5CA7B for ; Thu, 11 Jan 2024 06:42:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96C0EC43399; Thu, 11 Jan 2024 06:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704955342; bh=gbX4YWfRwjVnF49sDXj1O3cCSmmOzMm5S1M/X7oiEXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GB1XxKtKwAbjoCUkLjjJoGupyaPxCfXinyIZtxjj9h2gCF7xtiv/z0/J3XLuA3w2M B2LfimX/2MM/HUA3rnD7W3oZBvb2aw67It4G85AaSbvCt9yQKfVNYUBcZcZhmqZcnc cs+kHcWdfDgP8ZNs0MNVS4He1flN5E+DXouJPZfCxAtfF3pOnyXHHQ004IhPeMlBu5 V1gUtCtI4XF1IjTXutmIDXqs4VAEwbPoV+eHeCub7gz2HmD13o4DK7m8RSAmZP8lF8 oae/LmsEx/b1c9a0FvZ7IWl6ik8/Sjhi9TxMrYQBrLWWFUFNz0idA9eUankiINLg+C KIlJksLKi0+tg== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: [PATCH v4 5/6] f2fs: fix to remove unnecessary f2fs_bug_on() to avoid panic Date: Thu, 11 Jan 2024 14:42:07 +0800 Message-Id: <20240111064208.2969599-5-chao@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240111064208.2969599-1-chao@kernel.org> References: <20240111064208.2969599-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