btrfs: assert block group is locked in btrfs_use_block_group_size_class()

It's supposed to be called with the block group locked, in order to read
and set its size_class member, so assert it's locked.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Filipe Manana 2026-01-20 12:09:20 +00:00 committed by David Sterba
parent 0bf63d385f
commit 954f3217f6

View File

@ -4755,6 +4755,7 @@ int btrfs_use_block_group_size_class(struct btrfs_block_group *bg,
enum btrfs_block_group_size_class size_class,
bool force_wrong_size_class)
{
lockdep_assert_held(&bg->lock);
ASSERT(size_class != BTRFS_BG_SZ_NONE);
/* The new allocation is in the right size class, do nothing */