From d831290debf7cc5741c30233d05aa18c9a59e99e Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Mon, 21 Jan 2013 12:49:44 +0530 Subject: glusterd: Use client-op-versions during "volume set" The supported op-versions of the client and the name of the requested volume, are saved during server_getspec(). These are used during the staging of volume set. If the option being set is not supported by any of the clients which currently have the volume mounted, then set will fail. Change-Id: I4e6b60b274d5200508762dc0204cfa848a6c0aa4 BUG: 907311 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/4424 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-handshake.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-handshake.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c index 5b3299d549a..8b964702669 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handshake.c +++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c @@ -127,8 +127,8 @@ server_getspec (rpcsvc_request_t *req) dict_t *dict = NULL; xlator_t *this = NULL; glusterd_conf_t *conf = NULL; - int client_min_op_version = 0; - int client_max_op_version = 0; + int client_min_op_version = 1; // OP-VERSIONs start at 1 + int client_max_op_version = 1; this = THIS; GF_ASSERT (this); @@ -199,10 +199,22 @@ server_getspec (rpcsvc_request_t *req) req->trans->peerinfo.identifier); goto fail; } + } + // Store the op-versions supported by the client + req->trans->peerinfo.max_op_version = client_max_op_version; + req->trans->peerinfo.min_op_version = client_min_op_version; + volume = args.key; + // Store the name of volume being mounted + if (volume[0] == '/') + strncpy (req->trans->peerinfo.volname, &volume[1], + strlen(&volume[1])); + else + strncpy (req->trans->peerinfo.volname, volume, strlen(volume)); + trans = req->trans; ret = rpcsvc_transport_peername (trans, (char *)&addrstr, sizeof (addrstr)); -- cgit