From: Filipe Manana Date: Tue, 20 Jan 2026 12:09:20 +0000 (+0000) Subject: btrfs: assert block group is locked in btrfs_use_block_group_size_class() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=954f3217f60277ea035d747275df0ec5c68ad65c;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 635143a8eb079..11ed303c66409 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -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 */