diff options
author | Krishnan Parthasarathi <kp@gluster.com> | 2011-09-05 20:14:21 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-09-20 02:33:57 -0700 |
commit | a8b0cfdde84e1966830c09c5d75fd18a4b831bcb (patch) | |
tree | a94ad48183959bc30f59700a58c612bc17fb355f /rpc/rpc-lib | |
parent | 0f9502d5eb7e2f29e2428df3d55c28f3bc99b8ea (diff) |
rpc: Need to keep ref when handling cbk in call_bail.
Change-Id: Ic944599cfa2696a0ae77105185d49fb510ce6fec
BUG: 3511
Reviewed-on: http://review.gluster.com/396
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'rpc/rpc-lib')
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index 2ca2622d5c4..a22d154dbeb 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -196,10 +196,12 @@ call_bail (void *data) trav->rpcreq->procnum, trav->rpcreq->xid, frame_sent, conn->frame_timeout); + clnt = rpc_clnt_ref (clnt); trav->rpcreq->rpc_status = -1; trav->rpcreq->cbkfn (trav->rpcreq, &iov, 1, trav->frame); rpc_clnt_reply_deinit (trav->rpcreq, clnt->reqpool); + clnt = rpc_clnt_unref (clnt); list_del_init (&trav->list); mem_put (conn->rpc_clnt->saved_frames_pool, trav); } @@ -308,6 +310,7 @@ __saved_frame_get (struct saved_frames *frames, int64_t callid) void saved_frames_unwind (struct saved_frames *saved_frames) { + struct rpc_clnt *clnt = NULL; struct saved_frame *trav = NULL; struct saved_frame *tmp = NULL; struct mem_pool *saved_frames_pool = NULL; @@ -338,6 +341,7 @@ saved_frames_unwind (struct saved_frames *saved_frames) trav->rpcreq->procnum, timestr); saved_frames->count--; + clnt = rpc_clnt_ref (trav->rpcreq->conn->rpc_clnt); trav->rpcreq->rpc_status = -1; trav->rpcreq->cbkfn (trav->rpcreq, &iov, 1, trav->frame); @@ -346,6 +350,7 @@ saved_frames_unwind (struct saved_frames *saved_frames) rpc_clnt_reply_deinit (trav->rpcreq, trav->rpcreq->conn->rpc_clnt->reqpool); + clnt = rpc_clnt_unref (clnt); list_del_init (&trav->list); mem_put (saved_frames_pool, trav); } |