public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: sd_zbc: Disable zoned block devices with scsi-mq
@ 2017-08-17  2:45 Damien Le Moal
  2017-08-17  7:59 ` Christoph Hellwig
  0 siblings, 1 reply; 8+ messages in thread
From: Damien Le Moal @ 2017-08-17  2:45 UTC (permalink / raw)
  To: linux-scsi, Martin K . Petersen
  Cc: Hannes Reinecke, Christoph Hellwig, Bart Van Assche

blk-mq may not maintain write requests order at dispatch time. So host
managed drives will not reliably work. Worse, potential reordering of
write requests on requeue may cause the zone write locking code to
deadlock command dispatch to the disk. So for now, until the write
ordering issue is fixed, do not support zoned block devices with
scsi-mq by showing a 0 LBA capacity disk.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 drivers/scsi/sd_zbc.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
index 8aa54779aac1..07bd8511102a 100644
--- a/drivers/scsi/sd_zbc.c
+++ b/drivers/scsi/sd_zbc.c
@@ -561,6 +561,19 @@ int sd_zbc_read_zones(struct scsi_disk *sdkp,
 		 */
 		return 0;
 
+	/*
+	 * In the scsi-mq case, write ordering is not guaranteed so
+	 * host managed drives will not reliably work. Worse, zone write
+	 * locking can cause dispatch deadlocks. So for now, do not support
+	 * zoned block devices with scsi-mq by showing a 0 capacity disk.
+	 */
+	if (sdkp->disk->queue->mq_ops) {
+		if (sdkp->first_scan)
+			sd_printk(KERN_WARNING, sdkp,
+			  "Zoned block devices are not supported with scsi-mq\n");
+		ret = -ENODEV;
+		goto err;
+	}
 
 	/* Get zoned block device characteristics */
 	ret = sd_zbc_read_zoned_characteristics(sdkp, buf);
-- 
2.13.5

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

end of thread, other threads:[~2017-08-21 20:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-17  2:45 [PATCH] scsi: sd_zbc: Disable zoned block devices with scsi-mq Damien Le Moal
2017-08-17  7:59 ` Christoph Hellwig
2017-08-17 12:19   ` Damien Le Moal
2017-08-17 12:24     ` Damien Le Moal
2017-08-17 15:01     ` Bart Van Assche
2017-08-18  0:21       ` Damien Le Moal
2017-08-21 15:33       ` hch
2017-08-21 20:31         ` Martin K. Petersen

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