linux-stable/fs/btrfs/tests
Qu Wenruo d7255626a0 btrfs: tests/qgroup: Fix wrong tree backref level
[ Upstream commit 3c0efdf03b ]

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: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-30 07:52:26 +02:00
..
btrfs-tests.c btrfs: remove unused sectorsize member 2017-08-16 14:19:53 +02:00
btrfs-tests.h btrfs: pull node/sector/stripe sizes out of root and into fs_info 2016-12-06 16:06:58 +01:00
extent-buffer-tests.c btrfs: pull node/sector/stripe sizes out of root and into fs_info 2016-12-06 16:06:58 +01:00
extent-io-tests.c Btrfs: replace tree->mapping with tree->private_data 2017-06-19 18:25:58 +02:00
free-space-tests.c btrfs: pull node/sector/stripe sizes out of root and into fs_info 2016-12-06 16:06:58 +01:00
free-space-tree-tests.c btrfs: tests: Fix a memory leak in error handling path in 'run_test()' 2017-12-20 10:10:30 +01:00
inode-tests.c btrfs: Make get_extent_t take btrfs_inode 2017-02-28 11:30:11 +01:00
qgroup-tests.c btrfs: tests/qgroup: Fix wrong tree backref level 2018-05-30 07:52:26 +02:00