From 6c809f40a1a0b500aa09ccaa597dc7d95b1e5146 Mon Sep 17 00:00:00 2001 From: Ji-Hyeon Gim Date: Fri, 5 May 2017 16:51:19 +0900 Subject: rpc: fix a routine to destory RDMA qp(queue-pair) This is backport of https://review.gluster.org/#/c/17249/ Problem: If an error has occured with rdma_create_id() in gf_rdma_connect(), process will jump to the 'unlock' label and then call gf_rdma_teardown() which call __gf_rdma_teardown(). Presently, __gf_rdma_teardown() checks InifiniBand QP with peer->cm_id->qp! Unfortunately, cm_id is not allocated and will be crushed in this situation :) Solution: If 'this->private->peer->cm_id' member is null, do not check 'this->private->peer->cm_id->qp'. > Change-Id: Ie321b8cf175ef4f1bdd9733d73840f03ddff8c3b > BUG: 1449495 > Signed-off-by: Ji-Hyeon Gim > Reviewed-on: https://review.gluster.org/17249 > Reviewed-by: Amar Tumballi > Reviewed-by: Prashanth Pai > NetBSD-regression: NetBSD Build System > Tested-by: Ji-Hyeon Gim > CentOS-regression: Gluster Build System > Smoke: Gluster Build System > Reviewed-by: Jeff Darcy (cherry picked from commit ccfa06767f1282d9a3783e37555515a63cc62e69) Change-Id: Ie321b8cf175ef4f1bdd9733d73840f03ddff8c3b BUG: 1450565 Signed-off-by: Ji-Hyeon Gim Reviewed-on: https://review.gluster.org/17282 Smoke: Gluster Build System Tested-by: Ji-Hyeon Gim NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Amar Tumballi --- rpc/rpc-transport/rdma/src/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rpc') diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c index 14b068c05cb..8d9e6474f3c 100644 --- a/rpc/rpc-transport/rdma/src/rdma.c +++ b/rpc/rpc-transport/rdma/src/rdma.c @@ -3253,7 +3253,7 @@ __gf_rdma_teardown (rpc_transport_t *this) priv = this->private; peer = &priv->peer; - if (peer->cm_id->qp != NULL) { + if (peer->cm_id && peer->cm_id->qp != NULL) { __gf_rdma_destroy_qp (this); } -- cgit