btrfs: improve leaf dump and error handling
authorQu Wenruo <wqu@suse.com>
Thu, 27 Apr 2023 12:16:28 +0000 (20:16 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:23 +0000 (13:59 +0200)
commiteee3b811784e52f06ccb3e1c4518a9907627d4fe
tree4d0022a7c817edb470b572c3cb684f0ba5925789
parent6c75a589cb35b8ea5cf9a22f389981acf687ab85
btrfs: improve leaf dump and error handling

Improve the leaf dump behavior by:

- Always dump the leaf first, then the error message

- Output the slot number if possible
  Especially in __btrfs_free_extent() the leaf dump of extent tree can
  be pretty large.
  With an extra slot number it's much easier to locate the problem.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c
fs/btrfs/extent-tree.c