summaryrefslogtreecommitdiff
path: root/drivers/scsi/sd.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-12-17 17:53:59 +0100
committerJens Axboe <axboe@kernel.dk>2023-12-19 20:17:43 -0700
commit5cc99b89785c55430a5674b32ad0d9e57a8ec251 (patch)
tree62081b59beb5a7a433d97644b852b024b619193d /drivers/scsi/sd.c
parentd73e93b4dfab10c80688b061c30048df05585c7e (diff)
sd: only call disk_clear_zoned when needed
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> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20231217165359.604246-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r--drivers/scsi/sd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index dbed075cdb98..8c8ac5cd1833 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -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.