linux/fs/btrfs/tests
Qu Wenruo 529d936876 btrfs: tests/qgroup: Fix wrong tree backref level
commit 3c0efdf03b upstream.

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: faa2dbf004 ("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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-10-21 08:45:07 +01:00
..
btrfs-tests.c btrfs: prevent RCU warning when dereferencing radix tree slot 2014-06-13 09:52:22 -07:00
btrfs-tests.h Btrfs: add sanity tests for new qgroup accounting code 2014-06-09 17:20:49 -07:00
extent-buffer-tests.c Btrfs: add a sanity test for btrfs_split_item 2013-11-11 21:51:02 -05:00
extent-io-tests.c Btrfs: add tests for find_lock_delalloc_range 2013-11-11 21:56:51 -05:00
free-space-tests.c treewide: fix comments and printk msgs 2014-01-07 15:06:07 +01:00
inode-tests.c Btrfs: add sanity tests for new qgroup accounting code 2014-06-09 17:20:49 -07:00
qgroup-tests.c btrfs: tests/qgroup: Fix wrong tree backref level 2018-10-21 08:45:07 +01:00