Skip to content

Commit ae1fba2

Browse files
Keith Buschaxboe
authored andcommitted
NVMe: Requeue requests on suspended queues
It's possible a request may get to the driver after the nvme queue was disabled. This has the request requeue if that happens. Note the request is still "started" by the driver, but requeuing will clear the start state for timeout handling. Signed-off-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent ef2d461 commit ae1fba2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/nvme/host/pci.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,11 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
678678
blk_mq_start_request(req);
679679

680680
spin_lock_irq(&nvmeq->q_lock);
681+
if (unlikely(nvmeq->cq_vector < 0)) {
682+
ret = BLK_MQ_RQ_QUEUE_BUSY;
683+
spin_unlock_irq(&nvmeq->q_lock);
684+
goto out;
685+
}
681686
__nvme_submit_cmd(nvmeq, &cmnd);
682687
nvme_process_cq(nvmeq);
683688
spin_unlock_irq(&nvmeq->q_lock);

0 commit comments

Comments
 (0)