lib/nvme: add checks for new states in reconnect_io_qpair.
This function hasn't kept up properly with the states that we use for tracking the qpair lifecycle. Add checks for NVME_QPAIR_DISCONNECTING and NVME_QPAIR_DESTROYING. Signed-off-by: Seth Howell <seth.howell@intel.com> Change-Id: I51607d4f00e94937b08fca28e766163580d46461 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3359 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
757eddeb59
commit
c9bc86c061
@ -463,6 +463,7 @@ int
|
||||
spdk_nvme_ctrlr_reconnect_io_qpair(struct spdk_nvme_qpair *qpair)
|
||||
{
|
||||
struct spdk_nvme_ctrlr *ctrlr;
|
||||
enum nvme_qpair_state qpair_state;
|
||||
int rc;
|
||||
|
||||
assert(qpair != NULL);
|
||||
@ -471,23 +472,24 @@ spdk_nvme_ctrlr_reconnect_io_qpair(struct spdk_nvme_qpair *qpair)
|
||||
|
||||
ctrlr = qpair->ctrlr;
|
||||
nvme_robust_mutex_lock(&ctrlr->ctrlr_lock);
|
||||
qpair_state = nvme_qpair_get_state(qpair);
|
||||
|
||||
if (ctrlr->is_removed) {
|
||||
rc = -ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (ctrlr->is_resetting) {
|
||||
if (ctrlr->is_resetting || qpair_state == NVME_QPAIR_DISCONNECTING) {
|
||||
rc = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (ctrlr->is_failed) {
|
||||
if (ctrlr->is_failed || qpair_state == NVME_QPAIR_DESTROYING) {
|
||||
rc = -ENXIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (nvme_qpair_get_state(qpair) != NVME_QPAIR_DISCONNECTED) {
|
||||
if (qpair_state != NVME_QPAIR_DISCONNECTED) {
|
||||
rc = 0;
|
||||
goto out;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user