Commit 529f7f3b authored by Seth Howell's avatar Seth Howell Committed by Ben Walker
Browse files

Revert "nvmf: ensure that destroying qpairs have a state_cb"



This reverts commit 238bc1de8082a20b11bd60a231cf03f34f1a4c60.

Change-Id: If9041b33bb95582406518f73b601671fae11e984
Signed-off-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/419731


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent 4bfb557d
Loading
Loading
Loading
Loading
+7 −11
Original line number Diff line number Diff line
@@ -669,17 +669,6 @@ _spdk_nvmf_qpair_deactivate(void *ctx)
	struct nvmf_qpair_disconnect_ctx *qpair_ctx = ctx;
	struct spdk_nvmf_qpair *qpair = qpair_ctx->qpair;

	/* Check for outstanding I/O */
	if (!TAILQ_EMPTY(&qpair->outstanding)) {
		if (qpair->state_cb != NULL) {
			qpair->state_cb = _spdk_nvmf_qpair_destroy;
			qpair->state_cb_arg = qpair_ctx;
		} else {
			free(qpair_ctx);
		}
		return;
	}

	if (qpair->state == SPDK_NVMF_QPAIR_DEACTIVATING ||
	    qpair->state == SPDK_NVMF_QPAIR_INACTIVE) {
		/* This can occur if the connection is killed by the target,
@@ -695,6 +684,13 @@ _spdk_nvmf_qpair_deactivate(void *ctx)
	assert(qpair->state == SPDK_NVMF_QPAIR_ACTIVE);
	qpair->state = SPDK_NVMF_QPAIR_DEACTIVATING;

	/* Check for outstanding I/O */
	if (!TAILQ_EMPTY(&qpair->outstanding)) {
		qpair->state_cb = _spdk_nvmf_qpair_destroy;
		qpair->state_cb_arg = qpair_ctx;
		return;
	}

	_spdk_nvmf_qpair_destroy(qpair_ctx, 0);
}