diff options
author | Filipe Manana <fdmanana@suse.com> | 2024-01-25 09:53:26 +0000 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2024-03-04 16:24:46 +0100 |
commit | edebd19a4ad032498914d790737b14766ae743cb (patch) | |
tree | 060947b04d031e13430416da705a24b5a9d84dc4 /fs/btrfs/tree-log.h | |
parent | 4d9450113e60def0bece006d0f8ef7c5f26adf60 (diff) |
btrfs: add comment about list_is_singular() use at btrfs_delete_unused_bgs()
At btrfs_delete_unused_bgs(), the use of the list_is_singular() check on
a block group may not be immediately obvious. It is there to prevent
losing raid profile information for a block group type (data, metadata or
system), as that information is removed from
fs_info->avail_[data|metadata|system]_alloc_bits when the last block group
of a given type is deleted. So deleting the block group would later result
in creating block groups of that type with a single profile (because
fs_info->avail_*_alloc_bits would have a value of 0).
This check was added in commit aefbe9a633b5 ("btrfs: Fix lost-data-profile
caused by auto removing bg").
So add a comment mentioning the need for the check.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.h')
0 files changed, 0 insertions, 0 deletions