mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-22 14:13:04 +00:00
btrfs-progs: check: properly exclude leaves for lowmem mode
The lowmem mode excludes all referenced blocks from the allocator in order to avoid accidentally overwriting blocks while fixing the file system. However for leaves it wouldn't exclude anything, it would just pin them down, which gets cleaned up on transaction commit. We're safe for the first modification, but subsequent modifications could blow up in our face. Fix this by properly excluding leaves as well as all of the nodes. Reviewed-by: Su Yue <l@damenly.su> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
be6710f89d
commit
3f467adb34
@ -667,8 +667,12 @@ static int traverse_tree_blocks(struct extent_buffer *eb, int tree_root, int pin
|
|||||||
|
|
||||||
/* If we aren't the tree root don't read the block */
|
/* If we aren't the tree root don't read the block */
|
||||||
if (level == 1 && !tree_root) {
|
if (level == 1 && !tree_root) {
|
||||||
btrfs_pin_extent(gfs_info, bytenr,
|
if (pin)
|
||||||
gfs_info->nodesize);
|
btrfs_pin_extent(gfs_info, bytenr,
|
||||||
|
gfs_info->nodesize);
|
||||||
|
else
|
||||||
|
set_extent_dirty(tree, bytenr,
|
||||||
|
gfs_info->nodesize);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user