Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2689251rdd; Fri, 12 Jan 2024 19:58:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKQTbnk0JDuTtOmkK/1syjg1gT4mBUMV03nyj0Y3qdsFOWBvG2iEjjnwEw9if0wDFZ5UOU X-Received: by 2002:a05:6e02:1070:b0:360:1031:2fd1 with SMTP id q16-20020a056e02107000b0036010312fd1mr2110579ilj.110.1705118299873; Fri, 12 Jan 2024 19:58:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705118299; cv=none; d=google.com; s=arc-20160816; b=wypIaZ+0Tk4KJLaxPfZrkARp/QxOS4fW9uQESLNufldR1vJXvxk8Qmy8DGJZ6e0PG3 Qfb07mQRGEEA4RhERtp+m7mljkUlDb71n4E6vusKvuteGgqnRFsVMvFXmd0zo3woN9vl CG2TBJb7kxMGbz36KRnhCboXNmHEvW9YlQxW80xX/tpY/mr4AaUMmhxi3xUHvFhredFu KfCbhsscWbO7Zsy/vHoE9wIaImK+iGPmqZztCXchVR/tSsfIJDk5XMwrV8RGP328fvqF Ba0OhqeZ6ylDCPx9Upj+KQxdu5Zp6N4oDm5JVb4sHbL4VE9hhk8chHP9AXIOKYJ9MGtd jBwA== 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=BukD3JAQCP39cvO9gL9YjkxyctgLPkQmOkajwpajTt8=; fh=3gbPhre1OB9gPaTtmCq689W9XI462kLAqPsb9Z8n0A8=; b=OJnjxg8QfqaaPCWVex3KOQURAa/bzXsgqFpNkWBPreWkpjc+c4Xad4X98jXFiIWmaQ w1dVSaMhOQDwf80J3fbr7OXKFQLe6mQvGHKfyJUDqNYZh3nD/2lGCfC3FT/J6v1mRdCj 4R6aF3XQ5yY29hxF9TBLgEbOiMFswOCpBrU0d1h/aKtMgb+5YJ46Gl62RS0VfY9gbGCA 80+6xur+BtdLzmlHLK4GExS772WuUsrxw5xasWq5KLRJxqvMXRdZxyL9+iHLpS4VFDyF G25l8KdPvA7xQVxxBJbRuznz2XBlFNaN6cevKIwMsnmUwllfdirF/bOgVMDlWaHZoxMU ugnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f7pX6qAv; spf=pass (google.com: domain of linux-kernel+bounces-25190-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25190-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t12-20020a170902bc4c00b001d5947f5193si4193895plz.0.2024.01.12.19.58.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 19:58:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25190-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f7pX6qAv; spf=pass (google.com: domain of linux-kernel+bounces-25190-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25190-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 86A47286FC6 for ; Sat, 13 Jan 2024 03:58:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C27A91A701; Sat, 13 Jan 2024 03:57:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f7pX6qAv" 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 001AE19454 for ; Sat, 13 Jan 2024 03:57:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 722A8C433A6; Sat, 13 Jan 2024 03:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705118248; bh=SD4fUAPJzN+uvRFc7mA/nW29W2wE766je65+7EHnk/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f7pX6qAv4QWcmyVcM0N8hs2jXBfnQxuaoTct/5CLyHPjilaqJZMFGK8SO9fQ4sLq/ ccW4m6q/ColKurPEwwFgqle55HWe1LeNVcIf+AZfN5BM48duRlLrN9tQ+PddLGzpP9 HVevzbToVs5KN8We5ANKc7Q50q+Dgtm7pRY3y2HlpTgGbB22RuaSNHin9JeIPKie8n g1+/ceNaZF5ZhfCUd5xofzEj8/gvMfX7gqyPcr5xpAa+4Bw0ImkN8yrFtfqLelugAC bt/wDSTrgI5ngPh1t6hXhTQMC5zo2KjZdDZ5pYFa5TTJEtWtcDHc2amWJjyPKaBXBV OfxZkxOp1oJig== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu , Daeho Jeong Subject: [PATCH v5 5/6] f2fs: fix to remove unnecessary f2fs_bug_on() to avoid panic Date: Sat, 13 Jan 2024 03:41:31 +0800 Message-Id: <20240112194132.25637-5-chao@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240112194132.25637-1-chao@kernel.org> References: <20240112194132.25637-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()") Reviewed-by: Daeho Jeong 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