All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 1/2] btrfs: add error message for metadata level mismatch
Date: Thu, 29 Dec 2022 07:32:23 +0800	[thread overview]
Message-ID: <0d9b80c4616b78c7d5129b1ae92d9b45c2d8cab4.1672190127.git.wqu@suse.com> (raw)
In-Reply-To: <cover.1672190127.git.wqu@suse.com>

From a recent regression report, we found that after commit 947a629988f1
("btrfs: move tree block parentness check into
validate_extent_buffer()") if we have a level mismatch (false alert
though), there is no error message at all.

This makes later debug much harder.

This patch will add the proper error message for such case.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/disk-io.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index f8b5955f003f..ec48adba2ae9 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -530,6 +530,10 @@ static int validate_extent_buffer(struct extent_buffer *eb,
 	}
 
 	if (found_level != check->level) {
+		btrfs_err(fs_info,
+	"level verify failed on logical %llu mirror %u wanted %u found %u",
+			  eb->start, eb->read_mirror, check->level,
+			  found_level);
 		ret = -EIO;
 		goto out;
 	}
-- 
2.39.0


  reply	other threads:[~2022-12-28 23:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-28 23:32 [PATCH 0/2] btrfs: fixes for commit 947a629988f1 ("btrfs: move tree block parentness check into validate_extent_buffer()") Qu Wenruo
2022-12-28 23:32 ` Qu Wenruo [this message]
2022-12-28 23:32 ` [PATCH 2/2] btrfs: fix the false alert on bad tree level Qu Wenruo
2023-01-02 15:14   ` David Sterba
2023-01-02 15:13 ` [PATCH 0/2] btrfs: fixes for commit 947a629988f1 ("btrfs: move tree block parentness check into validate_extent_buffer()") David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d9b80c4616b78c7d5129b1ae92d9b45c2d8cab4.1672190127.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.