public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: Add more details while checking tree block
@ 2018-06-22  1:52 Su Yue
  2018-06-22 11:44 ` David Sterba
  2018-06-22 11:48 ` Nikolay Borisov
  0 siblings, 2 replies; 11+ messages in thread
From: Su Yue @ 2018-06-22  1:52 UTC (permalink / raw)
  To: linux-btrfs; +Cc: suy.fnst

For easier debug, print eb->start if level is invalid.
Also make print clear if bytenr found is not expected.

Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
---
 fs/btrfs/disk-io.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index c3504b4d281b..a90dab84f41b 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -615,8 +615,8 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
 
 	found_start = btrfs_header_bytenr(eb);
 	if (found_start != eb->start) {
-		btrfs_err_rl(fs_info, "bad tree block start %llu %llu",
-			     found_start, eb->start);
+		btrfs_err_rl(fs_info, "bad tree block start want %llu have %llu",
+			     eb->start, found_start);
 		ret = -EIO;
 		goto err;
 	}
@@ -628,8 +628,8 @@ static int btree_readpage_end_io_hook(struct btrfs_io_bio *io_bio,
 	}
 	found_level = btrfs_header_level(eb);
 	if (found_level >= BTRFS_MAX_LEVEL) {
-		btrfs_err(fs_info, "bad tree block level %d",
-			  (int)btrfs_header_level(eb));
+		btrfs_err(fs_info, "bad tree block level %d on %llu",
+			  (int)btrfs_header_level(eb), eb->start);
 		ret = -EIO;
 		goto err;
 	}
-- 
2.17.1




^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-06-22 18:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-22  1:52 [PATCH] btrfs: Add more details while checking tree block Su Yue
2018-06-22 11:44 ` David Sterba
2018-06-22 11:48 ` Nikolay Borisov
     [not found]   ` <CABnRu560BS0NDcuEEfexR-vkqTOMpUkAB0bWYSM8G2957yTm6w@mail.gmail.com>
2018-06-22 15:17     ` Fwd: " Su Yue
2018-06-22 15:26   ` Hans van Kranenburg
2018-06-22 15:40     ` Hugo Mills
2018-06-22 16:15       ` Su Yue
2018-06-22 16:17     ` Su Yue
2018-06-22 16:25       ` Nikolay Borisov
2018-06-22 16:29         ` Hans van Kranenburg
2018-06-22 18:26           ` Noah Massey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox