public inbox for dm-devel@redhat.com
 help / color / mirror / Atom feed
* [PATCH] dm: use READ_ONCE in dm_blk_report_zones
@ 2026-01-08 19:56 Mikulas Patocka
  2026-01-08 20:42 ` Benjamin Marzinski
  0 siblings, 1 reply; 2+ messages in thread
From: Mikulas Patocka @ 2026-01-08 19:56 UTC (permalink / raw)
  To: Alasdair Kergon, Mike Snitzer, Benjamin Marzinski; +Cc: dm-devel

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: 37f53a2c60d0 ("dm: fix dm_blk_report_zones")

---
 drivers/md/dm-zone.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/md/dm-zone.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-zone.c	2026-01-06 22:57:00.000000000 +0100
+++ linux-2.6/drivers/md/dm-zone.c	2026-01-06 22:57:00.000000000 +0100
@@ -50,7 +50,7 @@ int dm_blk_report_zones(struct gendisk *
 {
 	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;
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-01-08 20:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08 19:56 [PATCH] dm: use READ_ONCE in dm_blk_report_zones Mikulas Patocka
2026-01-08 20:42 ` Benjamin Marzinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox