summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2010-09-15 06:49:56 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-15 07:18:14 -0700
commitc109ffb893ab80dd7b9dac038f5778961859ceff (patch)
tree27bdaf888e941008abe496c4dc4721b5950d3ba4 /xlators/mgmt/glusterd/src/glusterd3_1-mops.c
parent89ec6582d1977c98372cb69f6471fcfde8437bb7 (diff)
cli, mgmt/glusterd: disallow probe to a cluster
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1594 (make probe oneway) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1594
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd3_1-mops.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd3_1-mops.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
index a9dfa6d411b..9435099906c 100644
--- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
+++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
@@ -60,6 +60,7 @@ glusterd3_1_probe_cbk (struct rpc_req *req, struct iovec *iov,
glusterd_peerinfo_t *dup_peerinfo = NULL;
glusterd_friend_sm_event_t *event = NULL;
glusterd_peer_hostname_t *name = NULL;
+ glusterd_probe_ctx_t *ctx = NULL;
conf = THIS->private;
@@ -79,9 +80,20 @@ glusterd3_1_probe_cbk (struct rpc_req *req, struct iovec *iov,
gf_log ("glusterd", GF_LOG_NORMAL,
"Received probe resp from uuid: %s, host: %s",
str, rsp.hostname);
+ if (rsp.op_ret != 0) {
+ ctx = ((call_frame_t *)myframe)->local;
+ ((call_frame_t *)myframe)->local = NULL;
- ret = glusterd_friend_find (rsp.uuid, rsp.hostname, &peerinfo);
+ GF_ASSERT (ctx);
+ glusterd_xfer_cli_probe_resp (ctx->req, rsp.op_ret,
+ rsp.op_errno,
+ ctx->hostname, ctx->port);
+ ret = rsp.op_ret;
+ (void) glusterd_friend_remove (rsp.uuid, rsp.hostname);
+ goto out;
+ }
+ ret = glusterd_friend_find (rsp.uuid, rsp.hostname, &peerinfo);
if (ret) {
GF_ASSERT (0);
}
@@ -93,6 +105,7 @@ glusterd3_1_probe_cbk (struct rpc_req *req, struct iovec *iov,
glusterd_peer_hostname_new (rsp.hostname, &name);
list_add_tail (&name->hostname_list, &peerinfo->hostnames);
peerinfo->rpc = dup_peerinfo->rpc;
+ peerinfo->connected = dup_peerinfo->connected;
glusterd_peer_destroy (dup_peerinfo);
}
if (!peerinfo->hostname)