diff options
author | Raghavendra G <raghavendra@gluster.com> | 2011-01-31 03:29:13 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-02-07 11:32:57 -0800 |
commit | ffbbb6a17075714865820a2f9722edcd70a4436f (patch) | |
tree | 384cee928702bee50d772fc040e5ab789af0457d /rpc/rpc-lib | |
parent | 3bad56d0d39e132b43d0122a570ba1b59a9a7caa (diff) |
rpc/rpc-clnt: don't access rpcreq after putting the struct back into mem-pool.
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2335 (Segmentation fault in saved_frames_unwind)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2335
Diffstat (limited to 'rpc/rpc-lib')
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c index f25a4b0ade1..d496673217a 100644 --- a/rpc/rpc-lib/src/rpc-clnt.c +++ b/rpc/rpc-lib/src/rpc-clnt.c @@ -307,11 +307,13 @@ __saved_frame_get (struct saved_frames *frames, int64_t callid) return saved_frame; } + void saved_frames_unwind (struct saved_frames *saved_frames) { struct saved_frame *trav = NULL; struct saved_frame *tmp = NULL; + struct mem_pool *saved_frames_pool = NULL; struct tm *frame_sent_tm = NULL; char timestr[256] = {0,}; @@ -329,22 +331,25 @@ saved_frames_unwind (struct saved_frames *saved_frames) continue; gf_log_callingfn ("rpc-clnt", GF_LOG_ERROR, - "forced unwinding frame type(%s) op(%s(%d)) " - "called at %s", - trav->rpcreq->prog->progname, - (trav->rpcreq->prog->procnames) ? - trav->rpcreq->prog->procnames[trav->rpcreq->procnum] - : "--", - trav->rpcreq->procnum, timestr); + "forced unwinding frame type(%s) op(%s(%d)) " + "called at %s", + trav->rpcreq->prog->progname, + (trav->rpcreq->prog->procnames) ? + trav->rpcreq->prog->procnames[trav->rpcreq->procnum] + : "--", + trav->rpcreq->procnum, timestr); saved_frames->count--; trav->rpcreq->rpc_status = -1; trav->rpcreq->cbkfn (trav->rpcreq, &iov, 1, trav->frame); + + saved_frames_pool + = trav->rpcreq->conn->rpc_clnt->saved_frames_pool; rpc_clnt_reply_deinit (trav->rpcreq, trav->rpcreq->conn->rpc_clnt->reqpool); list_del_init (&trav->list); - mem_put (trav->rpcreq->conn->rpc_clnt->saved_frames_pool, trav); + mem_put (saved_frames_pool, trav); } } |