diff options
| author | Filipe Manana <[email protected]> | 2025-09-08 11:51:11 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2025-09-15 03:25:43 +0000 |
| commit | 80eb65ccf6f72dc37b972583fe71cd8a50ff7e51 (patch) | |
| tree | a11e23151f9939a13f2f3bee9d13ebbdd7da8aba /fs/btrfs/send.c | |
| parent | btrfs: initialize inode::file_extent_tree after i_mode has been set (diff) | |
| download | kernel-80eb65ccf6f72dc37b972583fe71cd8a50ff7e51.tar.gz kernel-80eb65ccf6f72dc37b972583fe71cd8a50ff7e51.zip | |
btrfs: annotate block group access with data_race() when sorting for reclaim
When sorting the block group list for reclaim we are using a block group's
used bytes counter without taking the block group's spinlock, so we can
race with a concurrent task updating it (at btrfs_update_block_group()),
which makes tools like KCSAN unhappy and report a race.
Since the sorting is not strictly needed from a functional perspective
and such races should rarely cause any ordering changes (only load/store
tearing could cause them), not to mention that after the sorting the
ordering may no longer be accurate due to concurrent allocations and
deallocations of extents in a block group, annotate the accesses to the
used counter with data_race() to silence KCSAN and similar tools.
Reviewed-by: Qu Wenruo <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Signed-off-by: Filipe Manana <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/send.c')
0 files changed, 0 insertions, 0 deletions
