nvmf: Disconnect qpair whose ctrlr is not set yet when removing listener
We have very frequent failures when we run test/nvmf/host/multipath.sh in the test pool. Call stack showed nvmf_stop_listen_disconnect_qpairs() accessed qpair->ctrlr even if qpair->ctrlr was NULL. nvmf_stop_listen_disconnect_qpairs() did not check if qpair->ctrlr is not NULL before accessing qpair->ctrlr->subsys. When a qpair is added to a poll group, qpair->ctrlr is cleared to NULL. The test code test/nvmf/host/multipath.sh executes multiple reconnects for path error. So a conflict might occur between adding a qpair to a poll group and disconnecting a qpair in a poll group. In this case, it may be acceptable even if we disconnect a qpair whose qpair->ctrlr is NULL. It will be better than SIGSEGV. Fixes one of the issues in #2300 Signed-off-by: Shuhei Matsumoto <shuheimatsumoto@gmail.com> Change-Id: I308fcb886dd410d01e3361c1850dec9a8eacbccf Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10860 Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
833a5c9d2b
commit
44f69b654b
@ -410,7 +410,7 @@ nvmf_stop_listen_disconnect_qpairs(struct spdk_io_channel_iter *i)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!spdk_nvme_transport_id_compare(&ctx->trid, &tmp_trid)) {
|
if (!spdk_nvme_transport_id_compare(&ctx->trid, &tmp_trid)) {
|
||||||
if (ctx->subsystem == NULL ||
|
if (ctx->subsystem == NULL || qpair->ctrlr == NULL ||
|
||||||
ctx->subsystem == qpair->ctrlr->subsys) {
|
ctx->subsystem == qpair->ctrlr->subsys) {
|
||||||
spdk_nvmf_qpair_disconnect(qpair, NULL, NULL);
|
spdk_nvmf_qpair_disconnect(qpair, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user