Commit bf58ef1
block: freeze queue when updating zone resources
commit bba4322 upstream.
Modify disk_update_zone_resources() to freeze the device queue before
updating the number of zones, zone capacity and other zone related
resources. The locking order resulting from the call to
queue_limits_commit_update_frozen() is preserved, that is, the queue
limits lock is first taken by calling queue_limits_start_update() before
freezing the queue, and the queue is unfrozen after executing
queue_limits_commit_update(), which replaces the call to
queue_limits_commit_update_frozen().
This change ensures that there are no in-flights I/Os when the zone
resources are updated due to a zone revalidation. In case of error when
the limits are applied, directly call disk_free_zone_resources() from
disk_update_zone_resources() while the disk queue is still frozen to
avoid needing to freeze & unfreeze the queue again in
blk_revalidate_disk_zones(), thus simplifying that function code a
little.
Fixes: 0b83c86 ("block: Prevent potential deadlock in blk_revalidate_disk_zones()")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent ce909de commit bf58ef1
1 file changed
Lines changed: 24 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1516 | 1516 | | |
1517 | 1517 | | |
1518 | 1518 | | |
1519 | | - | |
| 1519 | + | |
1520 | 1520 | | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
1521 | 1526 | | |
1522 | 1527 | | |
1523 | 1528 | | |
| |||
1527 | 1532 | | |
1528 | 1533 | | |
1529 | 1534 | | |
1530 | | - | |
| 1535 | + | |
| 1536 | + | |
1531 | 1537 | | |
1532 | 1538 | | |
1533 | | - | |
1534 | | - | |
1535 | 1539 | | |
1536 | 1540 | | |
1537 | 1541 | | |
| |||
1568 | 1572 | | |
1569 | 1573 | | |
1570 | 1574 | | |
1571 | | - | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
1572 | 1584 | | |
1573 | 1585 | | |
1574 | 1586 | | |
| |||
1733 | 1745 | | |
1734 | 1746 | | |
1735 | 1747 | | |
1736 | | - | |
| 1748 | + | |
1737 | 1749 | | |
1738 | 1750 | | |
1739 | 1751 | | |
| |||
1783 | 1795 | | |
1784 | 1796 | | |
1785 | 1797 | | |
1786 | | - | |
1787 | | - | |
1788 | | - | |
1789 | | - | |
1790 | 1798 | | |
1791 | | - | |
1792 | | - | |
1793 | | - | |
1794 | | - | |
1795 | | - | |
| 1799 | + | |
1796 | 1800 | | |
1797 | | - | |
1798 | | - | |
1799 | | - | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
1800 | 1806 | | |
1801 | 1807 | | |
1802 | 1808 | | |
| |||
0 commit comments