summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorMohammed Junaid <junaid@redhat.com>2012-05-11 12:51:38 +0530
committerVijay Bellur <vijay@gluster.com>2012-05-25 09:33:25 -0700
commit65275d048bb031f93a690c69cb32bb751298c212 (patch)
treec367ab763d3237049964cbba6844b9db5621d48c /xlators/protocol
parent0917026a3629cd8bfb9af73f1c8d5a333c2bf569 (diff)
protocol/client: Concatenate the graph uuid along with process uuid in setlk_version.
Change-Id: Idec06c5ef1d440864e465f008a38c86395b52aba BUG: 820831 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.com/3439 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client-handshake.c28
-rw-r--r--xlators/protocol/server/src/server-helpers.c2
2 files changed, 19 insertions, 11 deletions
diff --git a/xlators/protocol/client/src/client-handshake.c b/xlators/protocol/client/src/client-handshake.c
index 09f301a1dd2..64e0c356db1 100644
--- a/xlators/protocol/client/src/client-handshake.c
+++ b/xlators/protocol/client/src/client-handshake.c
@@ -454,13 +454,13 @@ client_set_lk_version_cbk (struct rpc_req *req, struct iovec *iov,
ret = 0;
out:
- //TODO: Check for all released fdctx and destroy them
if (fr)
STACK_DESTROY (fr->root);
return ret;
}
+//TODO: Check for all released fdctx and destroy them
int
client_set_lk_version (xlator_t *this)
{
@@ -469,16 +469,24 @@ client_set_lk_version (xlator_t *this)
call_frame_t *frame = NULL;
gf_set_lk_ver_req req = {0, };
+ GF_VALIDATE_OR_GOTO ("client", this, err);
+
conf = (clnt_conf_t *) this->private;
req.lk_ver = client_get_lk_ver (conf);
- req.uid = this->ctx->process_uuid;
-
- gf_log (this->name, GF_LOG_DEBUG, "Sending SET_LK_VERSION");
+ ret = gf_asprintf (&req.uid, "%s-%s-%d",
+ this->ctx->process_uuid, this->name,
+ this->graph->id);
+ if (ret == -1)
+ goto err;
frame = create_frame (this, this->ctx->pool);
- if (!frame)
+ if (!frame) {
+ ret = -1;
goto out;
+ }
+
+ gf_log (this->name, GF_LOG_DEBUG, "Sending SET_LK_VERSION");
ret = client_submit_request (this, &req, frame,
conf->handshake,
@@ -487,11 +495,11 @@ client_set_lk_version (xlator_t *this)
NULL, NULL, 0, NULL, 0, NULL,
(xdrproc_t)xdr_gf_set_lk_ver_req);
out:
- if (ret < 0) {
- //TODO: Check for all released fdctx and destroy them
- gf_log (this->name, GF_LOG_WARNING,
- "Failed to send SET_LK_VERSION to server");
- }
+ GF_FREE (req.uid);
+ return ret;
+err:
+ gf_log (this->name, GF_LOG_WARNING,
+ "Failed to send SET_LK_VERSION to server");
return ret;
}
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index 51086aaf907..8827a48b041 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -687,7 +687,7 @@ server_connection_get (xlator_t *this, const char *id)
pthread_mutex_lock (&conf->mutex);
{
list_for_each_entry (trav, &conf->conns, list) {
- if (!strncmp (trav->id, id, strlen (id))) {
+ if (!strcmp (trav->id, id)) {
conn = trav;
conn->bind_ref++;
goto unlock;