]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: ref-verify: pass down tree block level when building refs
authorJosef Bacik <josef@toxicpanda.com>
Wed, 16 Dec 2020 16:18:46 +0000 (11:18 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Feb 2021 21:58:50 +0000 (22:58 +0100)
commit42f3ad4788e1df88ff19062c827dcd32f1d0fb87
tree5aa56b156fbef97a6e0efab42bb4f1f0b74ff413
parente0e76af8ccc96c404afbc0f9e1caadd239434d08
btrfs: ref-verify: pass down tree block level when building refs

I noticed that sometimes I would have the wrong level printed out with
ref-verify while testing some error injection related problems.  This is
because we only get the level from the main extent item, but our
references could go off the current leaf into another, and at that point
we lose our level.

Fix this by keeping track of the last tree block level that we found,
the same way we keep track of our bytenr and num_bytes, in case we
happen to wander into another leaf while still processing the references
for a bytenr.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ref-verify.c