Skip to content

Commit c0041b5

Browse files
adam900710kdave
authored andcommitted
btrfs: print-tree: print header owner as signed
When dumping a tree block, btrfs_header::owner is printed as unsigned, which can result in numbers that are hard to read, e.g.: BTRFS info (device loop0): leaf 8908800 gen 16 total ptrs 28 free space 1676 owner 18446744073709551607 For the above output, 18446744073709551607 is (s64)-9, the root id of data reloc tree. Despite those predefined root ids that are already negative, existing subvolume trees will not have any negative values, as subvolume trees can only utilize the lower 48 bits, so there will be no output change for existing subvolumes, thus no extra confusion. Reviewed-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Sun YangKai <sunk67188@gmail.com> Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 9e37d18 commit c0041b5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/btrfs/print-tree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ void btrfs_print_leaf(const struct extent_buffer *l)
449449
nr = btrfs_header_nritems(l);
450450

451451
btrfs_info(fs_info,
452-
"leaf %llu gen %llu total ptrs %d free space %d owner %llu",
452+
"leaf %llu gen %llu total ptrs %d free space %d owner %lld",
453453
btrfs_header_bytenr(l), btrfs_header_generation(l), nr,
454-
btrfs_leaf_free_space(l), btrfs_header_owner(l));
454+
btrfs_leaf_free_space(l), (s64)btrfs_header_owner(l));
455455
print_eb_refs_lock(l);
456456
for (i = 0 ; i < nr ; i++) {
457457
char key_buf[KEY_TYPE_BUF_SIZE];
@@ -600,10 +600,10 @@ void btrfs_print_tree(const struct extent_buffer *c, bool follow)
600600
return;
601601
}
602602
btrfs_info(fs_info,
603-
"node %llu level %d gen %llu total ptrs %d free spc %u owner %llu",
603+
"node %llu level %d gen %llu total ptrs %d free spc %u owner %lld",
604604
btrfs_header_bytenr(c), level, btrfs_header_generation(c),
605605
nr, (u32)BTRFS_NODEPTRS_PER_BLOCK(fs_info) - nr,
606-
btrfs_header_owner(c));
606+
(s64)btrfs_header_owner(c));
607607
print_eb_refs_lock(c);
608608
for (i = 0; i < nr; i++) {
609609
btrfs_node_key_to_cpu(c, &key, i);

0 commit comments

Comments
 (0)