btrfs-progs: make generic_err print physical address of extent buffer

Unlike kernel, we have cached physical address of extent_buffer in
dev_bytenr. Print it for better debug experience.

Signed-off-by: Su Yue <l@damenly.su>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Su Yue 2022-01-21 17:34:29 +08:00 committed by David Sterba
parent 1aa806a66c
commit e40f476bbb

View File

@ -590,9 +590,10 @@ static void generic_err(const struct extent_buffer *buf, int slot,
{
va_list args;
fprintf(stderr, "corrupt %s: root=%lld block=%llu slot=%d, ",
fprintf(stderr, "corrupt %s: root=%lld block=%llu physical=%llu slot=%d, ",
btrfs_header_level(buf) == 0 ? "leaf": "node",
btrfs_header_owner(buf), btrfs_header_bytenr(buf), slot);
btrfs_header_owner(buf), btrfs_header_bytenr(buf),
buf->dev_bytenr, slot);
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);