Skip to content

Commit e2c1887

Browse files
adam900710kdave
authored andcommitted
btrfs: print-tree: add generation and type dump for EXTENT_DATA_KEY
When debugging the recent ram_bytes mismatch bug, I can hit it with enhanced tree-checker for file extent items at write time. But the bug is not that easy to trigger (mostly triggered with btrfs/06*, which uses 20 threads fsstress), and when I hit it, the only info is the kernel leaf dump, but it doesn't include things like the file extent type (REGULAR or PREALLOC). Add the dump for generation and type (although only numeric output) to make debugging a little easier. Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 0e962e7 commit e2c1887

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/btrfs/print-tree.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ void btrfs_print_leaf(const struct extent_buffer *l)
310310
case BTRFS_EXTENT_DATA_KEY:
311311
fi = btrfs_item_ptr(l, i,
312312
struct btrfs_file_extent_item);
313+
pr_info("\t\tgeneration %llu type %hhu\n",
314+
btrfs_file_extent_generation(l, fi),
315+
btrfs_file_extent_type(l, fi));
313316
if (btrfs_file_extent_type(l, fi) ==
314317
BTRFS_FILE_EXTENT_INLINE) {
315318
pr_info("\t\tinline extent data size %llu\n",

0 commit comments

Comments
 (0)