diff options
author | Keith Busch <keith.busch@intel.com> | 2015-03-26 15:49:33 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-03-31 12:36:06 -0400 |
commit | 6df3dbc83fb8043a5975d75970d296d6d14f7273 (patch) | |
tree | a26081013f618bc7ead04aa4f6035f7396a1e997 /drivers/block | |
parent | cbc4ffdbe72a1bad3dbed27bb6b2eaba2b11bcc3 (diff) |
NVMe: Freeze admin queue on device failure
This fixes a race accessing an invalid address when a controller's admin
queue is in use during a reset for failure or hot removal occurs. The
admin queue will be frozen to prevent new users from entering prior to
the doorbell queue being unmapped.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nvme-core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index ceb32dd52a6c..ee83554c28ba 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c | |||
@@ -1347,6 +1347,9 @@ static int nvme_suspend_queue(struct nvme_queue *nvmeq) | |||
1347 | nvmeq->cq_vector = -1; | 1347 | nvmeq->cq_vector = -1; |
1348 | spin_unlock_irq(&nvmeq->q_lock); | 1348 | spin_unlock_irq(&nvmeq->q_lock); |
1349 | 1349 | ||
1350 | if (!nvmeq->qid && nvmeq->dev->admin_q) | ||
1351 | blk_mq_freeze_queue_start(nvmeq->dev->admin_q); | ||
1352 | |||
1350 | irq_set_affinity_hint(vector, NULL); | 1353 | irq_set_affinity_hint(vector, NULL); |
1351 | free_irq(vector, nvmeq); | 1354 | free_irq(vector, nvmeq); |
1352 | 1355 | ||
@@ -1378,8 +1381,6 @@ static void nvme_disable_queue(struct nvme_dev *dev, int qid) | |||
1378 | adapter_delete_sq(dev, qid); | 1381 | adapter_delete_sq(dev, qid); |
1379 | adapter_delete_cq(dev, qid); | 1382 | adapter_delete_cq(dev, qid); |
1380 | } | 1383 | } |
1381 | if (!qid && dev->admin_q) | ||
1382 | blk_mq_freeze_queue_start(dev->admin_q); | ||
1383 | 1384 | ||
1384 | spin_lock_irq(&nvmeq->q_lock); | 1385 | spin_lock_irq(&nvmeq->q_lock); |
1385 | nvme_process_cq(nvmeq); | 1386 | nvme_process_cq(nvmeq); |