Skip to content

Commit 3c0efdf

Browse files
adam900710kdave
authored andcommitted
btrfs: tests/qgroup: Fix wrong tree backref level
The extent tree of the test fs is like the following: BTRFS info (device (null)): leaf 16327509003777336587 total ptrs 1 free space 3919 item 0 key (4096 168 4096) itemoff 3944 itemsize 51 extent refs 1 gen 1 flags 2 tree block key (68719476736 0 0) level 1 ^^^^^^^ ref#0: tree block backref root 5 And it's using an empty tree for fs tree, so there is no way that its level can be 1. For REAL (created by mkfs) fs tree backref with no skinny metadata, the result should look like: item 3 key (30408704 EXTENT_ITEM 4096) itemoff 3845 itemsize 51 refs 1 gen 4 flags TREE_BLOCK tree block key (256 INODE_ITEM 0) level 0 ^^^^^^^ tree block backref root 5 Fix the level to 0, so it won't break later tree level checker. Fixes: faa2dbf ("Btrfs: add sanity tests for new qgroup accounting code") Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 8434ec4 commit 3c0efdf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/tests/qgroup-tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static int insert_normal_tree_ref(struct btrfs_root *root, u64 bytenr,
6363
btrfs_set_extent_generation(leaf, item, 1);
6464
btrfs_set_extent_flags(leaf, item, BTRFS_EXTENT_FLAG_TREE_BLOCK);
6565
block_info = (struct btrfs_tree_block_info *)(item + 1);
66-
btrfs_set_tree_block_level(leaf, block_info, 1);
66+
btrfs_set_tree_block_level(leaf, block_info, 0);
6767
iref = (struct btrfs_extent_inline_ref *)(block_info + 1);
6868
if (parent > 0) {
6969
btrfs_set_extent_inline_ref_type(leaf, iref,

0 commit comments

Comments
 (0)