mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
btrfs: account block group tree when calculating global reserve size
commit 8dbfc14fc7
upstream.
When using the block group tree feature, this tree is a critical tree just
like the extent, csum and free space trees, and just like them it uses the
delayed refs block reserve.
So take into account the block group tree, and its current size, when
calculating the size for the global reserve.
CC: stable@vger.kernel.org # 6.1+
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2c28c5c52e
commit
1e8087589b
1 changed files with 5 additions and 0 deletions
|
@ -349,6 +349,11 @@ void btrfs_update_global_block_rsv(struct btrfs_fs_info *fs_info)
|
|||
}
|
||||
read_unlock(&fs_info->global_root_lock);
|
||||
|
||||
if (btrfs_fs_compat_ro(fs_info, BLOCK_GROUP_TREE)) {
|
||||
num_bytes += btrfs_root_used(&fs_info->block_group_root->root_item);
|
||||
min_items++;
|
||||
}
|
||||
|
||||
/*
|
||||
* But we also want to reserve enough space so we can do the fallback
|
||||
* global reserve for an unlink, which is an additional
|
||||
|
|
Loading…
Reference in a new issue