diff options
| author | Keith Busch <keith.busch@intel.com> | 2018-06-06 10:13:06 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2018-06-08 14:51:11 -0400 |
| commit | ded45505dbfdcaf1e49ae0349e5dafb59c9efbe5 (patch) | |
| tree | 190b52254902749ccf70927a9432ab3668438a91 | |
| parent | 397c699fb096e7a822990990c17c6b43e829cfc4 (diff) | |
nvme-pci: queue creation fixes
We've been ignoring NVMe error status on queue creations. Fortunately they
are uncommon, but we should handle these anyway. This patch adds checks
for the a positive error return value that indicates an NVMe status.
If we do see a negative return, the controller isn't usable, so this
patch returns immediately in since we can't unwind that failure.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
| -rw-r--r-- | drivers/nvme/host/pci.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 4963a407e728..7a42ccad3864 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c | |||
| @@ -1475,11 +1475,13 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid) | |||
| 1475 | */ | 1475 | */ |
| 1476 | vector = dev->num_vecs == 1 ? 0 : qid; | 1476 | vector = dev->num_vecs == 1 ? 0 : qid; |
| 1477 | result = adapter_alloc_cq(dev, qid, nvmeq, vector); | 1477 | result = adapter_alloc_cq(dev, qid, nvmeq, vector); |
| 1478 | if (result < 0) | 1478 | if (result) |
| 1479 | goto out; | 1479 | return result; |
| 1480 | 1480 | ||
| 1481 | result = adapter_alloc_sq(dev, qid, nvmeq); | 1481 | result = adapter_alloc_sq(dev, qid, nvmeq); |
| 1482 | if (result < 0) | 1482 | if (result < 0) |
| 1483 | return result; | ||
| 1484 | else if (result) | ||
| 1483 | goto release_cq; | 1485 | goto release_cq; |
| 1484 | 1486 | ||
| 1485 | /* | 1487 | /* |
| @@ -1501,7 +1503,6 @@ release_sq: | |||
| 1501 | adapter_delete_sq(dev, qid); | 1503 | adapter_delete_sq(dev, qid); |
| 1502 | release_cq: | 1504 | release_cq: |
| 1503 | adapter_delete_cq(dev, qid); | 1505 | adapter_delete_cq(dev, qid); |
| 1504 | out: | ||
| 1505 | return result; | 1506 | return result; |
| 1506 | } | 1507 | } |
| 1507 | 1508 | ||
