diff mbox series

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

Message ID 20190527042204.27666-1-wqu@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: Output extent tree leaf if we failed to find a backref | expand

Commit Message

Qu Wenruo May 27, 2019, 4:22 a.m. UTC
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 uncertain 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>
---
 extent-tree.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

David Sterba May 27, 2019, 2:12 p.m. UTC | #1
On Mon, May 27, 2019 at 12:22:04PM +0800, Qu Wenruo wrote:
> 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 uncertain 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>

Added to devel, thanks.
diff mbox series

Patch

diff --git a/extent-tree.c b/extent-tree.c
index 1cff617baa97..db69c538bf2f 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -2177,6 +2177,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;
 	}