Spdk/lib/nvmf
Shuhei Matsumoto 44f69b654b 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>
2021-12-29 02:19:58 +00:00
..
ctrlr_bdev.c nvmf/ctrlr_bdev: Set DNR bit in status for failed NVMe passthru 2021-12-03 08:13:52 +00:00
ctrlr_discovery.c nvmf: add new 'id' to spdk_nvmf_subsystem_listener 2021-12-20 18:12:41 +00:00
ctrlr.c nvmf: allow to override aer limit by specific transport 2021-12-14 13:18:45 +00:00
fc_ls.c spelling: lib 2021-12-03 08:12:55 +00:00
fc.c nvmf/fc: remove unused variable 2021-12-16 08:43:39 +00:00
Makefile nvmf/ctrlr: let transport can set VID SSVID and IEEE values 2021-12-06 23:17:07 +00:00
nvmf_fc.h spelling: lib 2021-12-03 08:12:55 +00:00
nvmf_internal.h nvmf: add new 'id' to spdk_nvmf_subsystem_listener 2021-12-20 18:12:41 +00:00
nvmf_rpc.c nvmf: fix disconnect logic for remove_listener RPC 2021-12-21 08:15:47 +00:00
nvmf.c nvmf: remove accept poller from generic layer 2021-12-14 13:18:33 +00:00
rdma.c nvmf/rdma: Move definitions of rxe vendor IDs to common rdma.h 2021-12-23 08:44:40 +00:00
spdk_nvmf.map lib/nvmf : Added support for ZCOPY 2021-07-23 08:34:43 +00:00
subsystem.c nvmf: add new 'id' to spdk_nvmf_subsystem_listener 2021-12-20 18:12:41 +00:00
tcp.c nvmf/tcp: update completion cid when aborting requests 2021-12-23 08:41:41 +00:00
transport.c nvmf: Disconnect qpair whose ctrlr is not set yet when removing listener 2021-12-29 02:19:58 +00:00
transport.h nvmf: remove accept poller from generic layer 2021-12-14 13:18:33 +00:00
vfio_user.c nvmf/vfio-user: fix the compilation issue on kernel 4.9.x 2021-12-16 08:45:58 +00:00