mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-08 15:15:48 -04:00
btrfs: add data_race() in btrfs_account_ro_block_groups_free_space()
Surround the intentional empty list check with the data_race() annotation so that tools like KCSAN don't report a data race. The race is intentional as it's harmless and we want to avoid lock contention of the space_info since its lock is heavily used (space reservation, space flushing, extent allocation and deallocation, etc). Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.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:
committed by
David Sterba
parent
8b6e1f5dce
commit
cdf8a566ee
@@ -1948,7 +1948,7 @@ u64 btrfs_account_ro_block_groups_free_space(struct btrfs_space_info *sinfo)
|
||||
int factor;
|
||||
|
||||
/* It's df, we don't care if it's racy */
|
||||
if (list_empty(&sinfo->ro_bgs))
|
||||
if (data_race(list_empty(&sinfo->ro_bgs)))
|
||||
return 0;
|
||||
|
||||
spin_lock(&sinfo->lock);
|
||||
|
||||
Reference in New Issue
Block a user