summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-09-15 09:41:40 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-15 08:18:37 -0700
commit0e2c2f46ddc36ccedeea8b42f7789f09224b5c9f (patch)
tree2adf456b907d255699f414c17b94a9554dbbe363
parente7535ad313d08ec587311729f049397d3ed995ce (diff)
check req structure in the ctx before transferring probe responsev3.1.0qa24
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1614 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1614
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd3_1-mops.c9
2 files changed, 10 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 102cc01c98f..715f3c800dd 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -2383,7 +2383,7 @@ glusterd_handle_probe_query (rpcsvc_request_t *req)
GF_ASSERT (0);
goto out;
}
- ret = glusterd_friend_find (NULL, remote_hostname, &peerinfo);
+ ret = glusterd_friend_find (probe_req.uuid, remote_hostname, &peerinfo);
if ((ret == 0 ) || list_empty (&conf->peers)) {
ret = glusterd_peer_hostname_new (probe_req.hostname, &name);
@@ -2392,12 +2392,14 @@ glusterd_handle_probe_query (rpcsvc_request_t *req)
} else {
list_add_tail (&name->hostname_list, &conf->hostnames);
}
- uuid_copy (rsp.uuid, conf->uuid);
+
} else {
rsp.op_ret = -1;
rsp.op_errno = GF_PROBE_ANOTHER_CLUSTER;
}
+ uuid_copy (rsp.uuid, conf->uuid);
+
rsp.hostname = probe_req.hostname;
ret = glusterd_submit_reply (req, &rsp, NULL, 0, NULL,
diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
index 6adec5dfe62..07820a369ab 100644
--- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
+++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
@@ -86,9 +86,12 @@ glusterd3_1_probe_cbk (struct rpc_req *req, struct iovec *iov,
GF_ASSERT (ctx);
- glusterd_xfer_cli_probe_resp (ctx->req, rsp.op_ret,
- rsp.op_errno,
- ctx->hostname, ctx->port);
+ if (ctx->req) {
+ 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;