diff options
author | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-05-19 15:01:08 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2015-06-17 00:53:00 -0700 |
commit | e902df70f8157db4db503b7ec3c2635b08b3dcb2 (patch) | |
tree | ad114936a7f4ae3130831f735a3c62ac2a509a65 /rpc/rpc-lib/src/rpc-clnt-ping.c | |
parent | 1b9a2edf2c18324ae961dd143e9e9685a019087f (diff) |
rpc: fix possible deadlock left behind in d448fd1
See http://review.gluster.org/9613 for more details.
Change-Id: I05ac0267b8c6f4e9b354acbbdf5469835455fb10
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/10821
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'rpc/rpc-lib/src/rpc-clnt-ping.c')
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt-ping.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt-ping.c b/rpc/rpc-lib/src/rpc-clnt-ping.c index 0429bd31120..64d319d0057 100644 --- a/rpc/rpc-lib/src/rpc-clnt-ping.c +++ b/rpc/rpc-lib/src/rpc-clnt-ping.c @@ -70,8 +70,8 @@ __rpc_clnt_rearm_ping_timer (struct rpc_clnt *rpc, gf_timer_cbk_t cbk) } /* Must be called under conn->lock */ -static int -__rpc_clnt_remove_ping_timer (struct rpc_clnt *rpc) +int +rpc_clnt_remove_ping_timer_locked (struct rpc_clnt *rpc) { rpc_clnt_connection_t *conn = &rpc->conn; gf_timer_t *timer = NULL; @@ -117,7 +117,7 @@ rpc_clnt_ping_timer_expired (void *rpc_ptr) pthread_mutex_lock (&conn->lock); { - unref = __rpc_clnt_remove_ping_timer (rpc); + unref = rpc_clnt_remove_ping_timer_locked (rpc); gettimeofday (¤t, NULL); if (((current.tv_sec - conn->last_received.tv_sec) < @@ -188,7 +188,7 @@ rpc_clnt_ping_cbk (struct rpc_req *req, struct iovec *iov, int count, pthread_mutex_lock (&conn->lock); { if (req->rpc_status == -1) { - unref = __rpc_clnt_remove_ping_timer (rpc); + unref = rpc_clnt_remove_ping_timer_locked (rpc); if (unref) { gf_log (this->name, GF_LOG_WARNING, "socket or ib related error"); @@ -203,7 +203,7 @@ rpc_clnt_ping_cbk (struct rpc_req *req, struct iovec *iov, int count, goto unlock; } - unref = __rpc_clnt_remove_ping_timer (rpc); + unref = rpc_clnt_remove_ping_timer_locked (rpc); if (__rpc_clnt_rearm_ping_timer (rpc, rpc_clnt_start_ping) == -1) { gf_log (this->name, GF_LOG_WARNING, @@ -275,7 +275,7 @@ rpc_clnt_start_ping (void *rpc_ptr) pthread_mutex_lock (&conn->lock); { - unref = __rpc_clnt_remove_ping_timer (rpc); + unref = rpc_clnt_remove_ping_timer_locked (rpc); if (conn->saved_frames) { GF_ASSERT (conn->saved_frames->count >= 0); |