Commit d7cb6d7
block: RCU protect disk->conv_zones_bitmap
Ensure that a disk revalidation changing the conventional zones bitmap
of a disk does not cause invalid memory references when using the
disk_zone_is_conv() helper by RCU protecting the disk->conv_zones_bitmap
pointer.
disk_zone_is_conv() is modified to operate under the RCU read lock and
the function disk_set_conv_zones_bitmap() is added to update a disk
conv_zones_bitmap pointer using rcu_replace_pointer() with the disk
zone_wplugs_lock spinlock held.
disk_free_zone_resources() is modified to call
disk_update_zone_resources() with a NULL bitmap pointer to free the disk
conv_zones_bitmap. disk_set_conv_zones_bitmap() is also used in
disk_update_zone_resources() to set the new (revalidated) bitmap and
free the old one.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20241107064300.227731-2-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 8e71afb commit d7cb6d7
2 files changed
Lines changed: 32 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
354 | | - | |
355 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
356 | 362 | | |
357 | 363 | | |
358 | 364 | | |
| |||
1455 | 1461 | | |
1456 | 1462 | | |
1457 | 1463 | | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
1458 | 1482 | | |
1459 | 1483 | | |
1460 | 1484 | | |
| |||
1478 | 1502 | | |
1479 | 1503 | | |
1480 | 1504 | | |
1481 | | - | |
1482 | | - | |
| 1505 | + | |
1483 | 1506 | | |
1484 | 1507 | | |
1485 | 1508 | | |
| |||
1538 | 1561 | | |
1539 | 1562 | | |
1540 | 1563 | | |
1541 | | - | |
| 1564 | + | |
1542 | 1565 | | |
1543 | 1566 | | |
1544 | 1567 | | |
1545 | 1568 | | |
1546 | 1569 | | |
1547 | 1570 | | |
1548 | | - | |
1549 | | - | |
1550 | | - | |
1551 | | - | |
| 1571 | + | |
| 1572 | + | |
1552 | 1573 | | |
1553 | 1574 | | |
1554 | 1575 | | |
| |||
1817 | 1838 | | |
1818 | 1839 | | |
1819 | 1840 | | |
1820 | | - | |
1821 | | - | |
1822 | 1841 | | |
1823 | 1842 | | |
1824 | 1843 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
0 commit comments