Skip to content

Commit

Permalink
nvmf/rdma: make disconnect qp from cm event safe.
Browse files Browse the repository at this point in the history
The call to update_ibv_state could result in a segfault if the other
thread had already freed the qp and was just spinning on handling the
rdma event. By not updating the qpair state here, I don't think that we
lose any information about the qpair state. Especiallyy since just a
little bit later we update the qpair state to be in error.
There is nothing in the man pages about the cm events changing the ib
state although I imagine they are closely related. I just say that
because I believe that's why the update was originally in that spot.

fixes: GitHub issue #1110

Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477877 (master)
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>

(cherry picked from commit a27a377)
Change-Id: I3f87ff009bc2019464ed7c6920dd71e2b286b3fd
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478785
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
  • Loading branch information
Seth5141 authored and tomzawadzki committed Jan 2, 2020
1 parent f8a0750 commit 92b1758
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/nvmf/rdma.c
Expand Up @@ -2989,8 +2989,6 @@ nvmf_rdma_disconnect(struct rdma_cm_event *evt)

spdk_trace_record(TRACE_RDMA_QP_DISCONNECT, 0, 0, (uintptr_t)rqpair->cm_id, 0);

spdk_nvmf_rdma_update_ibv_state(rqpair);

spdk_nvmf_rdma_start_disconnect(rqpair);

return 0;
Expand Down

0 comments on commit 92b1758

Please sign in to comment.