792807a444
When we disconnect a qpair, part of the code path is calling _nvme_qpair_abort_queued_reqs. This takes care of aborting any requests that were queued waiting for slots to open on the submission queue. It walks the STAILQ one by one and manually completes them with ABORT status back to the caller. But if the callback path submits another request, this request may also get queued to the end of the queued_req TAILQ. This can result in an infinite loop. The solution is to use an STAILQ_SWAP to a local, empty STAILQ. Then we ensure we only abort the requests that were queued when _nvme_qpair_abort_queued_reqs() started executing. Fixes issue #1588. I used the multipath.sh test to reproduce this on my local system. If it ever dropped into the STAILQ loop in this function, we would hit the infinite loop. With this patch, I confirmed locally that now we safely avoid the infinite loop and the test passes. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I657db23efe5983bd8613c870ad62695a7fc7f689 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4284 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ziye Yang <ziye.yang@intel.com> Reviewed-by: <dongx.yi@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> |
||
---|---|---|
.. | ||
Makefile | ||
nvme_ctrlr_cmd.c | ||
nvme_ctrlr_ocssd_cmd.c | ||
nvme_ctrlr.c | ||
nvme_cuse.c | ||
nvme_cuse.h | ||
nvme_fabric.c | ||
nvme_internal.h | ||
nvme_io_msg.c | ||
nvme_io_msg.h | ||
nvme_ns_cmd.c | ||
nvme_ns_ocssd_cmd.c | ||
nvme_ns.c | ||
nvme_opal_internal.h | ||
nvme_opal.c | ||
nvme_pcie.c | ||
nvme_poll_group.c | ||
nvme_qpair.c | ||
nvme_quirks.c | ||
nvme_rdma.c | ||
nvme_tcp.c | ||
nvme_transport.c | ||
nvme_uevent.c | ||
nvme_uevent.h | ||
nvme.c | ||
spdk_nvme.map |