mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
dm: use READ_ONCE in dm_blk_report_zones
The functon dm_blk_report_zones reads md->zone_revalidate_map, however it
may change while the function is running. Use READ_ONCE.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 37f53a2c60 ("dm: fix dm_blk_report_zones")
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
This commit is contained in:
@@ -50,7 +50,7 @@ int dm_blk_report_zones(struct gendisk *disk, sector_t sector,
|
||||
{
|
||||
struct mapped_device *md = disk->private_data;
|
||||
struct dm_table *map;
|
||||
struct dm_table *zone_revalidate_map = md->zone_revalidate_map;
|
||||
struct dm_table *zone_revalidate_map = READ_ONCE(md->zone_revalidate_map);
|
||||
int srcu_idx, ret = -EIO;
|
||||
bool put_table = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user