From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FDA1EC8738 for ; Thu, 7 Sep 2023 16:21:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241952AbjIGQVz (ORCPT ); Thu, 7 Sep 2023 12:21:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240996AbjIGQVc (ORCPT ); Thu, 7 Sep 2023 12:21:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91CE876B8; Thu, 7 Sep 2023 09:18:47 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CEF6C4AF7C; Thu, 7 Sep 2023 15:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694101437; bh=w9ciwqXcEgv02AfI3nMnFAPNY2eIwhecY1uvdb8YIcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WA1tnHLZTEvMRYVkyOEUpW2l27n2Zc+AX5RXiqw/i6apQIHAnAqPzRrI1XMUkJdfU VKornElj12FMqVq0kRZjSNx49wjltNVSkXIl2SH9xC/lA7kljRUdxSExRiNpQhyQgy 7mPYKQXSfSyBRw2Z606vWtaegP1Ts2vOrNMYzholui9LZX7C8l/Wtj5PEhuiBBlaYH xip0brpBm1Y1EtxzoeIWZFSdUmBIQ/7eA4/HVwImTrsXX2SCCmcIxvUAl056EoMdVs FkjaqCPfzNcy1aiga+LHFN9zHzcnIq3enhaN9/9qFU5RaPmYfBfB/NqpqXCYJJ9GsC 2+DOkqL73TpBg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Qu Wenruo , David Sterba , Sasha Levin , clm@fb.com, josef@toxicpanda.com, linux-btrfs@vger.kernel.org Subject: [PATCH AUTOSEL 6.4 4/5] btrfs: output extra debug info if we failed to find an inline backref Date: Thu, 7 Sep 2023 11:43:48 -0400 Message-Id: <20230907154349.3421707-4-sashal@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230907154349.3421707-1-sashal@kernel.org> References: <20230907154349.3421707-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.4.15 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Qu Wenruo [ Upstream commit 7f72f50547b7af4ddf985b07fc56600a4deba281 ] [BUG] Syzbot reported several warning triggered inside lookup_inline_extent_backref(). [CAUSE] As usual, the reproducer doesn't reliably trigger locally here, but at least we know the WARN_ON() is triggered when an inline backref can not be found, and it can only be triggered when @insert is true. (I.e. inserting a new inline backref, which means the backref should already exist) [ENHANCEMENT] After the WARN_ON(), dump all the parameters and the extent tree leaf to help debug. Link: https://syzkaller.appspot.com/bug?extid=d6f9ff86c1d804ba2bc6 Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/extent-tree.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 10bffcb379148..55d5f67881dcf 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -869,6 +869,11 @@ int lookup_inline_extent_backref(struct btrfs_trans_handle *trans, err = -ENOENT; goto out; } else if (WARN_ON(ret)) { + btrfs_print_leaf(path->nodes[0]); + btrfs_err(fs_info, +"extent item not found for insert, bytenr %llu num_bytes %llu parent %llu root_objectid %llu owner %llu offset %llu", + bytenr, num_bytes, parent, root_objectid, owner, + offset); err = -EIO; goto out; } -- 2.40.1