lib/nvme: Don't re-queue I/O while disconnecting.
This can cause infinite loops if the callback tries to queue an additional I/O. Signed-off-by: Seth Howell <seth.howell@intel.com> Change-Id: I4b80b97d334082465d9228b799ef901645fa968e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1854 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
b874f65743
commit
af2d56ed94
@ -725,6 +725,11 @@ nvme_qpair_submit_request(struct spdk_nvme_qpair *qpair, struct nvme_request *re
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
/* This prevents us from entering an infinite loop when freeing queued I/O in disconnect. */
|
||||||
|
if (spdk_unlikely(nvme_qpair_get_state(qpair) == NVME_QPAIR_DISCONNECTING)) {
|
||||||
|
return -ENXIO;
|
||||||
|
}
|
||||||
|
|
||||||
if (spdk_unlikely(!STAILQ_EMPTY(&qpair->queued_req) && req->num_children == 0)) {
|
if (spdk_unlikely(!STAILQ_EMPTY(&qpair->queued_req) && req->num_children == 0)) {
|
||||||
/*
|
/*
|
||||||
* requests that have no children should be sent to the transport after all
|
* requests that have no children should be sent to the transport after all
|
||||||
|
Loading…
Reference in New Issue
Block a user