Skip to content

Commit bf7bd72

Browse files
nielsdoskdave
authored andcommitted
btrfs: add lockdep_assert_held to need_preemptive_reclaim
In a previous patch ("btrfs: extend locking to all space_info members accesses") the locking for the space_info members was extended in btrfs_preempt_reclaim_metadata_space because not all the member accesses that needed locks were actually locked (bytes_pinned et al). It was then suggested to also add a call to lockdep_assert_held to need_preemptive_reclaim. This function also works with space_info members. As of now, it has only two call sites which both hold the lock. Suggested-by: Johannes Thumshirn <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Niels Dossche <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 3777369 commit bf7bd72

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/space-info.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,8 @@ static bool need_preemptive_reclaim(struct btrfs_fs_info *fs_info,
737737
u64 thresh = div_factor_fine(space_info->total_bytes, 90);
738738
u64 used;
739739

740+
lockdep_assert_held(&space_info->lock);
741+
740742
/* If we're just plain full then async reclaim just slows us down. */
741743
if ((space_info->bytes_used + space_info->bytes_reserved +
742744
global_rsv_size) >= thresh)

0 commit comments

Comments
 (0)