btrfs-progs: Output extent tree leaf if we failed to find a backref

There is a bug report of BUG_ON() which is caused by __free_extent()
failed to lookup a backref extent:
  Failed to find [1429288337408, 168, 16384]
  btrfs unable to find ref byte nr 1429288583168 parent 0 root 2 owner 0 offset 0
  convert/source-ext2.c:834: ext2_copy_inodes: BUG_ON ret triggered, value -5
  ./btrfs-convert[0x410941]
  ./btrfs-convert(main+0x1fdc)[0x40d3b8]
  /lib64/libc.so.6(__libc_start_main+0xf3)[0x7f93bb7d2f33]
  ./btrfs-convert(_start+0x2e)[0x40a96e]

It's still unclear how this bug can be triggered, but adding such debug
output will provide more info for us to debug.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2019-05-27 12:22:04 +08:00 committed by David Sterba
parent 485da9d52d
commit c98155f07a
1 changed files with 2 additions and 0 deletions

View File

@ -2176,6 +2176,8 @@ static int __free_extent(struct btrfs_trans_handle *trans,
(unsigned long long)root_objectid,
(unsigned long long)owner_objectid,
(unsigned long long)owner_offset);
printf("path->slots[0]: %u path->nodes[0]:\n", path->slots[0]);
btrfs_print_leaf(path->nodes[0]);
ret = -EIO;
goto fail;
}