]> www.infradead.org Git - users/hch/block.git/commitdiff
sd: only call disk_clear_zoned when needed block-remove-zone-aware
authorChristoph Hellwig <hch@lst.de>
Fri, 15 Dec 2023 07:13:50 +0000 (08:13 +0100)
committerChristoph Hellwig <hch@lst.de>
Sat, 16 Dec 2023 04:26:37 +0000 (05:26 +0100)
disk_clear_zoned only needs to be called when a device reported zone
managed mode first and we clear it.  Add a check so that disk_clear_zoned
isn't called on devices that were never zoned.

This avoids a fairly expensive queue freezing when revalidating
conventional devices.

Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/sd.c

index dbed075cdb981a3769e5b97cca72e0da52818d78..8c8ac5cd1833b41cb0eb3ce3e068a6883299ddb8 100644 (file)
@@ -3149,7 +3149,7 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp)
                 * the device physical block size.
                 */
                blk_queue_zone_write_granularity(q, sdkp->physical_block_size);
-       } else {
+       } else if (blk_queue_is_zoned(q)) {
                /*
                 * Anything else.  This includes host-aware device that we treat
                 * as conventional.