diff options
author | Ji-Hyeon Gim <potatogim@gluesys.com> | 2017-05-05 16:54:36 +0900 |
---|---|---|
committer | Raghavendra Talur <rtalur@redhat.com> | 2017-05-13 21:04:36 +0000 |
commit | 4a2368c403f883f68522bc20906d23fc4406432b (patch) | |
tree | 8c38638ca01c79e57c30d4a4398fc06d1f52da67 | |
parent | 175217ea52d61b97f112c06c8b0f9361b0b0de42 (diff) |
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 <potatogim@potatogim.net>
> Reviewed-on: https://review.gluster.org/17249
> Reviewed-by: Amar Tumballi <amarts@redhat.com>
> Reviewed-by: Prashanth Pai <ppai@redhat.com>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> Tested-by: Ji-Hyeon Gim
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
(cherry picked from commit ccfa06767f1282d9a3783e37555515a63cc62e69)
Change-Id: Ie321b8cf175ef4f1bdd9733d73840f03ddff8c3b
BUG: 1450564
Signed-off-by: Ji-Hyeon Gim <potatogim@gluesys.com>
Reviewed-on: https://review.gluster.org/17281
Smoke: Gluster Build System <jenkins@build.gluster.org>
Tested-by: Ji-Hyeon Gim
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
-rw-r--r-- | rpc/rpc-transport/rdma/src/rdma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c index d2f04bd6d0c..8da8e3b01b3 100644 --- a/rpc/rpc-transport/rdma/src/rdma.c +++ b/rpc/rpc-transport/rdma/src/rdma.c @@ -3252,7 +3252,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); } |