From 92b1758771e8e2e0b39e7b7a5a7850a71dab9f67 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Thu, 12 Dec 2019 17:48:10 -0700 Subject: [PATCH] nvmf/rdma: make disconnect qp from cm event safe. 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 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477877 (master) Community-CI: Broadcom SPDK FC-NVMe CI (cherry picked from commit a27a377ac41a517cad5e11cc572adb759a37a47c) Change-Id: I3f87ff009bc2019464ed7c6920dd71e2b286b3fd Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478785 Tested-by: SPDK CI Jenkins Community-CI: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/nvmf/rdma.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index d701ae8de..63c2e17ed 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -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;