btrfs-progs: check: fix set_extent_dirty range

I screwed up a fix where we're setting the bytenr range as dirty when
marking all tree blocks used, I was looking at btrfs_pin_extent and put
->nodesize for end instead of the actual end, which is bytenr +
->nodesize - 1.  Fix this up so it's correct.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik 2021-11-10 15:07:52 -05:00 committed by David Sterba
parent 77db6bd402
commit 9fdb291b8e

View File

@ -664,7 +664,10 @@ static int traverse_tree_blocks(struct extent_buffer *eb, int tree_root, int pin
if (ret)
return ret;
} else {
u64 end;
bytenr = btrfs_node_blockptr(eb, i);
end = bytenr + gfs_info->nodesize - 1;
/* If we aren't the tree root don't read the block */
if (level == 1 && !tree_root) {
@ -672,8 +675,7 @@ static int traverse_tree_blocks(struct extent_buffer *eb, int tree_root, int pin
btrfs_pin_extent(gfs_info, bytenr,
gfs_info->nodesize);
else
set_extent_dirty(tree, bytenr,
gfs_info->nodesize);
set_extent_dirty(tree, bytenr, end);
continue;
}