nvmf/rdma: Query qp state prior to acknowledging disconnect event

This guarantees that the qpair memory still exists.

Change-Id: I759197b90513f30488aa46bd26535c663e64dae6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/423744
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ben Walker 2018-08-28 11:15:38 -07:00 committed by Jim Harris
parent 9f6d509bf9
commit 764346697a

View File

@ -947,14 +947,16 @@ nvmf_rdma_disconnect(struct rdma_cm_event *evt)
SPDK_ERRLOG("disconnect request: no active connection\n"); SPDK_ERRLOG("disconnect request: no active connection\n");
return -1; return -1;
} }
/* ack the disconnect event before rdma_destroy_id */
rdma_ack_cm_event(evt);
rqpair = SPDK_CONTAINEROF(qpair, struct spdk_nvmf_rdma_qpair, qpair); rqpair = SPDK_CONTAINEROF(qpair, struct spdk_nvmf_rdma_qpair, qpair);
spdk_nvmf_rdma_update_ibv_state(rqpair); spdk_nvmf_rdma_update_ibv_state(rqpair);
spdk_nvmf_qpair_disconnect(qpair, NULL, NULL); spdk_nvmf_qpair_disconnect(qpair, NULL, NULL);
/* The qpair memory is guaranteed to exist until this event is
* acknowledged. */
rdma_ack_cm_event(evt);
return 0; return 0;
} }