scsi: scsi-mq: Wait for .queue_rq() if necessary
authorBart Van Assche <[email protected]>
Wed, 23 Nov 2016 00:17:50 +0000 (16:17 -0800)
committerMartin K. Petersen <[email protected]>
Tue, 20 Dec 2016 22:01:28 +0000 (17:01 -0500)
Ensure that if scsi-mq is enabled that scsi_internal_device_block()
waits until ongoing shost->hostt->queuecommand() calls have finished.

Signed-off-by: Bart Van Assche <[email protected]>
Reviewed-by: Sagi Grimberg <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Doug Ledford <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
drivers/scsi/scsi_lib.c

index c35b6de4ca643297d1908341421c865c2cb93e84..9fd9a977c695e002b594073caf4c2d79327e59b9 100644 (file)
@@ -2893,7 +2893,7 @@ scsi_internal_device_block(struct scsi_device *sdev)
         * request queue. 
         */
        if (q->mq_ops) {
-               blk_mq_stop_hw_queues(q);
+               blk_mq_quiesce_queue(q);
        } else {
                spin_lock_irqsave(q->queue_lock, flags);
                blk_stop_queue(q);