]> 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)
commit3901136a7a7b23aa20bb0dd18e898b7473729d71
tree5aa56b156fbef97a6e0efab42bb4f1f0b74ff413
parent6ea74812d8a53012c970796c61b961e252d79481
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