Skip to content

Commit 9f96ec8

Browse files
fdmananakdave
authored andcommitted
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 <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]>
1 parent 1ea3aa3 commit 9f96ec8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/btrfs/block-group.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4755,6 +4755,7 @@ int btrfs_use_block_group_size_class(struct btrfs_block_group *bg,
47554755
enum btrfs_block_group_size_class size_class,
47564756
bool force_wrong_size_class)
47574757
{
4758+
lockdep_assert_held(&bg->lock);
47584759
ASSERT(size_class != BTRFS_BG_SZ_NONE);
47594760

47604761
/* The new allocation is in the right size class, do nothing */

0 commit comments

Comments
 (0)