nvmf/rdma: defer qp destruction until nvmf layer closes qp
Currently rqpair will be destroyed directly in ibv_poll_cq path if it has been drained, regardless of whether there are outstanding I/Os issued to bdev layer. So after outstanding I/Os completing, spdk_nvmf_rdma_close_qpair will be called from nvmf layer, accessing a destroyed qp. This path defers qp destruction in nvmf_rdma_destroy_drained_qpair func until nvmf layer closes qp. Fixes 851 Change-Id: I8bcce66f8053ddb105702ac603d5d73af54bdcfc Signed-off-by: lorneli <lorneli@163.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461237 Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Seth Howell <seth.howell@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
7dbdf87f63
commit
b4d3066890
@ -2672,6 +2672,12 @@ static void nvmf_rdma_destroy_drained_qpair(void *ctx)
|
||||
}
|
||||
|
||||
spdk_nvmf_rdma_qpair_process_pending(rtransport, rqpair, true);
|
||||
|
||||
/* Qpair will be destroyed after nvmf layer closes this qpair */
|
||||
if (rqpair->qpair.state != SPDK_NVMF_QPAIR_ERROR) {
|
||||
return;
|
||||
}
|
||||
|
||||
spdk_nvmf_rdma_qpair_destroy(rqpair);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user