Message ID | 20220121093429.1840437-1-l@damenly.su (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs-progs: make generic_err print physical address of extent buffer | expand |
On Fri, Jan 21, 2022 at 05:34:29PM +0800, Su Yue wrote: > 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> Added to devel, thanks.
diff --git a/kernel-shared/ctree.c b/kernel-shared/ctree.c index 21e5414965e7..950923d03165 100644 --- a/kernel-shared/ctree.c +++ b/kernel-shared/ctree.c @@ -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);
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> --- kernel-shared/ctree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)