lib/nvme: pass up rc from failed connect in reset.
Signed-off-by: Seth Howell <seth.howell@intel.com> Change-Id: I8041728de7bb7bdb35fb1570f3c2fb20feef8664 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3877 Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
316f92d118
commit
309200661f
@ -1194,7 +1194,7 @@ nvme_ctrlr_abort_queued_aborts(struct spdk_nvme_ctrlr *ctrlr)
|
|||||||
int
|
int
|
||||||
spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
|
spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0, rc_tmp = 0;
|
||||||
struct spdk_nvme_qpair *qpair;
|
struct spdk_nvme_qpair *qpair;
|
||||||
|
|
||||||
nvme_robust_mutex_lock(&ctrlr->ctrlr_lock);
|
nvme_robust_mutex_lock(&ctrlr->ctrlr_lock);
|
||||||
@ -1226,9 +1226,9 @@ spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
|
|||||||
|
|
||||||
ctrlr->adminq->transport_failure_reason = SPDK_NVME_QPAIR_FAILURE_LOCAL;
|
ctrlr->adminq->transport_failure_reason = SPDK_NVME_QPAIR_FAILURE_LOCAL;
|
||||||
nvme_transport_ctrlr_disconnect_qpair(ctrlr, ctrlr->adminq);
|
nvme_transport_ctrlr_disconnect_qpair(ctrlr, ctrlr->adminq);
|
||||||
if (nvme_transport_ctrlr_connect_qpair(ctrlr, ctrlr->adminq) != 0) {
|
rc = nvme_transport_ctrlr_connect_qpair(ctrlr, ctrlr->adminq);
|
||||||
|
if (rc != 0) {
|
||||||
SPDK_ERRLOG("Controller reinitialization failed.\n");
|
SPDK_ERRLOG("Controller reinitialization failed.\n");
|
||||||
rc = -1;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1257,9 +1257,10 @@ spdk_nvme_ctrlr_reset(struct spdk_nvme_ctrlr *ctrlr)
|
|||||||
if (rc == 0 && ctrlr->trid.trtype == SPDK_NVME_TRANSPORT_PCIE) {
|
if (rc == 0 && ctrlr->trid.trtype == SPDK_NVME_TRANSPORT_PCIE) {
|
||||||
/* Reinitialize qpairs */
|
/* Reinitialize qpairs */
|
||||||
TAILQ_FOREACH(qpair, &ctrlr->active_io_qpairs, tailq) {
|
TAILQ_FOREACH(qpair, &ctrlr->active_io_qpairs, tailq) {
|
||||||
if (nvme_transport_ctrlr_connect_qpair(ctrlr, qpair) != 0) {
|
rc_tmp = nvme_transport_ctrlr_connect_qpair(ctrlr, qpair);
|
||||||
|
if (rc_tmp != 0) {
|
||||||
|
rc = rc_tmp;
|
||||||
qpair->transport_failure_reason = SPDK_NVME_QPAIR_FAILURE_LOCAL;
|
qpair->transport_failure_reason = SPDK_NVME_QPAIR_FAILURE_LOCAL;
|
||||||
rc = -1;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user