diff options
author | Raghavendra G <raghavendra@gluster.com> | 2010-09-07 13:02:27 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-07 11:48:01 -0700 |
commit | 270dffa378a651369d6727fa38ae99934d953259 (patch) | |
tree | 4d63daba2a4b128220f646837f09fc3089255c76 /rpc/rpc-transport | |
parent | 171973d18d22e4f0f4117656c188d395bf3ac8a5 (diff) |
rpc-transport/rdma: fix memory corruptions caused by rdma.
- disconnect notification should be sent before unrefing transport,
since transport might be freed when unrefed.
- set trans->listener. This member is used by rpcsvc to decide whether
a listener or a new connection is dead.
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1558 (glusterd hung)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1558
Diffstat (limited to 'rpc/rpc-transport')
-rw-r--r-- | rpc/rpc-transport/rdma/src/rdma.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c index 2ea787cab4c..ccc759e7985 100644 --- a/rpc/rpc-transport/rdma/src/rdma.c +++ b/rpc/rpc-transport/rdma/src/rdma.c @@ -4253,11 +4253,11 @@ rdma_handshake_pollerr (rpc_transport_t *this) } pthread_mutex_unlock (&priv->write_mutex); + rpc_transport_notify (this, RPC_TRANSPORT_DISCONNECT, this); + if (need_unref) rpc_transport_unref (this); - rpc_transport_notify (this, RPC_TRANSPORT_DISCONNECT, this); - return 0; } @@ -4521,6 +4521,8 @@ rdma_server_event_handler (int fd, int idx, void *data, return -1; } + this->listener = trans; + priv = GF_CALLOC (1, sizeof (rdma_private_t), gf_common_mt_rdma_private_t); if (priv == NULL) { |