diff options
author | Pranith K <pranithk@gluster.com> | 2010-10-11 03:26:00 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-11 03:32:46 -0700 |
commit | 3dc782527482d2c62c9344669ccaa2dc42481a58 (patch) | |
tree | 2525af86d539725bf93564eb786eeeb0c10d9c38 /xlators/mgmt/glusterd/src/glusterd3_1-mops.c | |
parent | eb99bee0246d5a43bbee7383b3809a360aa70018 (diff) |
mgmt/glusterd: handle reqs from unknown peers for friend sm
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1838 (handle peer detach gracefully in case of lost frames)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1838
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd3_1-mops.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd3_1-mops.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c index fe9f4e528..b8abebf06 100644 --- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c +++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c @@ -188,7 +188,9 @@ glusterd3_1_friend_add_cbk (struct rpc_req * req, struct iovec *iov, ret = glusterd_friend_find (rsp.uuid, rsp.hostname, &peerinfo); if (ret) { - GF_ASSERT (0); + gf_log ("", GF_LOG_ERROR, "received friend add response from" + " unknown peer uuid: %s", str); + goto out; } if (op_ret) @@ -220,6 +222,7 @@ glusterd3_1_friend_add_cbk (struct rpc_req * req, struct iovec *iov, if (ret) goto out; +out: ctx = ((call_frame_t *)myframe)->local; ((call_frame_t *)myframe)->local = NULL; @@ -234,7 +237,6 @@ glusterd3_1_friend_add_cbk (struct rpc_req * req, struct iovec *iov, } if (ctx) glusterd_destroy_probe_ctx (ctx); -out: if (rsp.hostname) free (rsp.hostname);//malloced by xdr GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe)); @@ -285,9 +287,6 @@ glusterd3_1_friend_remove_cbk (struct rpc_req * req, struct iovec *iov, "Received %s from uuid: %s, host: %s, port: %d", (op_ret)?"RJT":"ACC", str, rsp.hostname, rsp.port); - if (op_ret) - goto respond; - inject: ret = glusterd_friend_find (rsp.uuid, ctx->hostname, &peerinfo); @@ -644,6 +643,14 @@ glusterd3_1_stage_op_cbk (struct rpc_req *req, struct iovec *iov, out: if (rsp.op_errstr && strcmp (rsp.op_errstr, "error")) free (rsp.op_errstr); //malloced by xdr + if (dict) { + if (!dict->extra_stdfree && rsp.dict.dict_val) + free (rsp.dict.dict_val); //malloced by xdr + dict_unref (dict); + } else { + if (rsp.dict.dict_val) + free (rsp.dict.dict_val); //malloced by xdr + } GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe)); return ret; } |