nvme: always return success from delete_io_qpair
It is not uncommon for delete_io_qpair to fail, for example when a controller is hot removed. So even if SQ or CQ deletion fails, continue with freeing resources and report success back up the stack. There is really nothing the application can do to account for this failing anyways. Upcoming patches will add additional checks to ensure failing delete_io_qpair status never gets propagated to the caller. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Iac007c1eba30f7a8c4936b3ffb6c837f28ee12ae Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8658 Reviewed-by: Ziye Yang <ziye.yang@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
2ac1521581
commit
c081a84cd2
@ -996,7 +996,7 @@ nvme_pcie_ctrlr_delete_io_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_
|
||||
status = calloc(1, sizeof(*status));
|
||||
if (!status) {
|
||||
SPDK_ERRLOG("Failed to allocate status tracker\n");
|
||||
return -ENOMEM;
|
||||
goto free;
|
||||
}
|
||||
|
||||
/* Delete the I/O submission queue */
|
||||
@ -1004,13 +1004,13 @@ nvme_pcie_ctrlr_delete_io_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_
|
||||
if (rc != 0) {
|
||||
SPDK_ERRLOG("Failed to send request to delete_io_sq with rc=%d\n", rc);
|
||||
free(status);
|
||||
return rc;
|
||||
goto free;
|
||||
}
|
||||
if (nvme_wait_for_completion(ctrlr->adminq, status)) {
|
||||
if (!status->timed_out) {
|
||||
free(status);
|
||||
}
|
||||
return -1;
|
||||
goto free;
|
||||
}
|
||||
|
||||
/* Now that the submission queue is deleted, the device is supposed to have
|
||||
@ -1024,13 +1024,13 @@ nvme_pcie_ctrlr_delete_io_qpair(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_
|
||||
if (rc != 0) {
|
||||
SPDK_ERRLOG("Failed to send request to delete_io_cq with rc=%d\n", rc);
|
||||
free(status);
|
||||
return rc;
|
||||
goto free;
|
||||
}
|
||||
if (nvme_wait_for_completion(ctrlr->adminq, status)) {
|
||||
if (!status->timed_out) {
|
||||
free(status);
|
||||
}
|
||||
return -1;
|
||||
goto free;
|
||||
}
|
||||
free(status);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user