summaryrefslogtreecommitdiff
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2023-01-21 16:06:11 +0800
committerDavid Sterba <dsterba@suse.com>2023-01-27 14:57:10 +0100
commita9ad4d87aa263de36895402b66115a3a4b88bf1c (patch)
treebd374be954377cb66fcbb35f592ef3bc1db016d5 /fs/btrfs/tree-log.c
parent33e17b3f5ab74af12aca58c515bc8424ff69a343 (diff)
btrfs: raid56: make error_bitmap update atomic
In the rework of raid56 code, there is very limited concurrency in the endio context. Most of the work is done inside the sectors arrays, which different bios will never touch the same sector. But there is a concurrency here for error_bitmap. Both read and write endio functions need to touch them, and we can have multiple write bios touching the same error bitmap if they all hit some errors. Here we fix the unprotected bitmap operation by going set_bit() in a loop. Since we have a very small ceiling of the sectors (at most 16 sectors), such set_bit() in a loop should be very acceptable. Fixes: 2942a50dea74 ("btrfs: raid56: introduce btrfs_raid_bio::error_bitmap") Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
0 files changed, 0 insertions, 0 deletions