diff options
author | Filipe Manana <fdmanana@suse.com> | 2025-05-12 12:31:24 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2025-05-15 14:30:57 +0200 |
commit | 7dbfa4266c5e1e72db274bcb60d17691bbea513e (patch) | |
tree | 4f241f1a9852865db6390f143f85664e3da6be25 /scripts/lib/kdoc/kdoc_parser.py | |
parent | 4469e95fe5d13f1788c6f5eb88d04365fd319a71 (diff) |
btrfs: fix harmless race getting delayed ref head count when running delayed refs
When running delayed references we are reading the number of ready delayed
ref heads without taking any lock which can make KCSAN report a race since
we can have concurrent tasks updating that number, such as for example
when freeing a tree block which will end up decrementing that counter or
when adding a new delayed ref while COWing a tree block which will
increment that counter.
This is a harmless race since running one more or one less delayed ref
head doesn't result in any problem, in the critical section of a
transaction commit we always run any remaining delayed refs and at that
point no one can create more.
So fix this harmless race by annotating the read with data_race().
Reported-by: cen zhang <zzzccc427@gmail.com>
Link: https://lore.kernel.org/linux-btrfs/CAFRLqsUCLMz0hY-GaPj1Z=fhkgRHjxVXHZ8kz0PvkFN0b=8L2Q@mail.gmail.com/
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions