summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kp@gluster.com>2011-09-27 18:38:00 +0530
committerVijay Bellur <vijay@gluster.com>2011-10-18 05:19:39 -0700
commitd5b0ae394e09cc048721b64adb8e8ca7fa66aeb2 (patch)
treefc74964c96ce0b4e5785ad5ebd7ec2617082c81c
parentc27db314b8f32b9bf4c3c6ce72edb16a25a7f4b8 (diff)
glusterd: Should not cleanup peerinfo too soon.
friend_remove_cbk cleans up peerinfo and the unrefs the associated rpc_clnt obj. When the cbk is run inside call_bail or saved_frames_unwind, we might end up destroying the rpc_clnt and associated saved_frames_pool while we are still using saved_frames to iterate through the frames. Change-Id: I9c43797cb35104d35b011c26d773a0b375248f2d BUG: 3511 Reviewed-on: http://review.gluster.com/514 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c1
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c7
2 files changed, 4 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 59e5d31549c..6013526db39 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -3531,6 +3531,7 @@ glusterd_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
break;
}
+ glusterd_friend_sm ();
return ret;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index e055d5e86c9..b8db4f18422 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -524,6 +524,7 @@ glusterd3_1_friend_remove_cbk (struct rpc_req * req, struct iovec *iov,
int32_t op_ret = -1;
int32_t op_errno = -1;
glusterd_probe_ctx_t *ctx = NULL;
+ gf_boolean_t move_sm_now = _gf_true;
conf = THIS->private;
GF_ASSERT (conf);
@@ -535,6 +536,7 @@ glusterd3_1_friend_remove_cbk (struct rpc_req * req, struct iovec *iov,
if (-1 == req->rpc_status) {
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
+ move_sm_now = _gf_false;
goto inject;
}
@@ -578,16 +580,13 @@ inject:
if (ret)
goto respond;
- glusterd_friend_sm ();
- glusterd_op_sm ();
-
op_ret = 0;
respond:
ret = glusterd_xfer_cli_deprobe_resp (ctx->req, op_ret, op_errno,
ctx->hostname);
- if (!ret) {
+ if (move_sm_now) {
glusterd_friend_sm ();
glusterd_op_sm ();
}