Skip to content

Commit c6664b4

Browse files
idryomovchrismason-xx
authored andcommitted
Btrfs: remove lock assert from get_restripe_target()
This fixes a regression introduced by fc67c45. spin_is_locked() always returns 0 on UP kernels, which caused assert in get_restripe_target() to be fired on every call from btrfs_reduce_alloc_profile() on UP systems. Remove it completely for now, it's not clear if it's going to be needed in future. Reported-by: Bobby Powers <[email protected]> Reported-by: Mitch Harder <[email protected]> Tested-by: Mitch Harder <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent b89203f commit c6664b4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/btrfs/extent-tree.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3152,15 +3152,14 @@ static void set_avail_alloc_bits(struct btrfs_fs_info *fs_info, u64 flags)
31523152
/*
31533153
* returns target flags in extended format or 0 if restripe for this
31543154
* chunk_type is not in progress
3155+
*
3156+
* should be called with either volume_mutex or balance_lock held
31553157
*/
31563158
static u64 get_restripe_target(struct btrfs_fs_info *fs_info, u64 flags)
31573159
{
31583160
struct btrfs_balance_control *bctl = fs_info->balance_ctl;
31593161
u64 target = 0;
31603162

3161-
BUG_ON(!mutex_is_locked(&fs_info->volume_mutex) &&
3162-
!spin_is_locked(&fs_info->balance_lock));
3163-
31643163
if (!bctl)
31653164
return 0;
31663165

0 commit comments

Comments
 (0)