Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>

authored by

Josef Bacik and committed by
Chris Mason
be2c765d d288db5d

+5 -4
+5 -4
fs/btrfs/print-tree.c
··· 54 54 btrfs_extent_data_ref_count(eb, ref)); 55 55 } 56 56 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) 58 58 { 59 59 struct btrfs_extent_item *ei; 60 60 struct btrfs_extent_inline_ref *iref; ··· 63 63 struct btrfs_disk_key key; 64 64 unsigned long end; 65 65 unsigned long ptr; 66 - int type; 67 66 u32 item_size = btrfs_item_size_nr(eb, slot); 68 67 u64 flags; 69 68 u64 offset; ··· 87 88 btrfs_extent_refs(eb, ei), btrfs_extent_generation(eb, ei), 88 89 flags); 89 90 90 - if (flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) { 91 + if ((type == BTRFS_EXTENT_ITEM_KEY) && 92 + flags & BTRFS_EXTENT_FLAG_TREE_BLOCK) { 91 93 struct btrfs_tree_block_info *info; 92 94 info = (struct btrfs_tree_block_info *)(ei + 1); 93 95 btrfs_tree_block_key(eb, info, &key); ··· 223 223 btrfs_disk_root_refs(l, ri)); 224 224 break; 225 225 case BTRFS_EXTENT_ITEM_KEY: 226 - print_extent_item(l, i); 226 + case BTRFS_METADATA_ITEM_KEY: 227 + print_extent_item(l, i, type); 227 228 break; 228 229 case BTRFS_TREE_BLOCK_REF_KEY: 229 230 printk(KERN_INFO "\t\ttree block backref\n");