Skip to content

Commit be2c765

Browse files
Josef Bacikmasoncl
authored andcommitted
Btrfs: fix btrfs_print_leaf for skinny metadata
We wouldn't actuall print the extent information if we had a skinny metadata item, this fixes that. Thanks, Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent d288db5 commit be2c765

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

fs/btrfs/print-tree.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static void print_extent_data_ref(struct extent_buffer *eb,
5454
btrfs_extent_data_ref_count(eb, ref));
5555
}
5656

57-
static void print_extent_item(struct extent_buffer *eb, int slot)
57+
static void print_extent_item(struct extent_buffer *eb, int slot, int type)
5858
{
5959
struct btrfs_extent_item *ei;
6060
struct btrfs_extent_inline_ref *iref;
@@ -63,7 +63,6 @@ static void print_extent_item(struct extent_buffer *eb, int slot)
6363
struct btrfs_disk_key key;
6464
unsigned long end;
6565
unsigned long ptr;
66-
int type;
6766
u32 item_size = btrfs_item_size_nr(eb, slot);
6867
u64 flags;
6968
u64 offset;
@@ -88,7 +87,8 @@ static void print_extent_item(struct extent_buffer *eb, int slot)
8887
btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei),
8988
flags);
9089

91-
if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) {
90+
if ((type == BTRFS_EXTENT_ITEM_KEY) &&
91+
flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) {
9292
struct btrfs_tree_block_info *info;
9393
info = (struct btrfs_tree_block_info *)(ei + 1);
9494
btrfs_tree_block_key(eb, info, &key);
@@ -223,7 +223,8 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
223223
btrfs_disk_root_refs(l, ri));
224224
break;
225225
case BTRFS_EXTENT_ITEM_KEY:
226-
print_extent_item(l, i);
226+
case BTRFS_METADATA_ITEM_KEY:
227+
print_extent_item(l, i, type);
227228
break;
228229
case BTRFS_TREE_BLOCK_REF_KEY:
229230
printk(KERN_INFO "\t\ttree block backref\n");

0 commit comments

Comments
 (0)