From cfefaaed76c72fd2ee142217b4de55a2c7518ba7 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Fri, 14 Aug 2015 10:15:25 +0530 Subject: glusterd/rebalance: trusted rebalance volfile Creating the client volfiles with GF_CLIENT_OTHER overwrites the trusted rebalance volfile and causes rebalance to fail if auth.allow is set. Now, we always set the value of trusted-client to GF_CLIENT_TRUSTED for rebalance volfiles. Change-Id: I95eb510256d18dfa9048f96a1aeb71cca4811811 BUG: 1253542 Signed-off-by: N Balachandran Reviewed-on: http://review.gluster.org/11819 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Avra Sengupta Reviewed-by: Rajesh Joseph Reviewed-by: Atin Mukherjee (cherry picked from commit 8603ac80218d6161416fd0f3cca511ba09aef2c8) Signed-off-by: Nithya Balachandran Reviewed-on: http://review.gluster.org/11915 --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index a08d8845c8b..06f786cd34c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -4217,16 +4217,19 @@ build_rebalance_volfile (glusterd_volinfo_t *volinfo, char *filepath, return 0; } + set_dict = dict_copy (volinfo->dict, NULL); + if (!set_dict) + return -1; + if (mod_dict) { - set_dict = dict_copy (volinfo->dict, NULL); - if (!set_dict) - return -1; dict_copy (mod_dict, set_dict); /* XXX dict_copy swallows errors */ - } else { - set_dict = volinfo->dict; } + /* Rebalance is always a trusted client*/ + ret = dict_set_uint32 (set_dict, "trusted-client", GF_CLIENT_TRUSTED); + if (ret) + return -1; ret = volgen_graph_build_clients (&graph, volinfo, set_dict, NULL); if (volinfo->type == GF_CLUSTER_TYPE_TIER) @@ -4256,13 +4259,12 @@ build_rebalance_volfile (glusterd_volinfo_t *volinfo, char *filepath, out: volgen_graph_free (&graph); - if (mod_dict) - dict_destroy (set_dict); - + dict_destroy (set_dict); return ret; - } + + static int build_shd_volume_graph (xlator_t *this, volgen_graph_t *graph, glusterd_volinfo_t *volinfo, -- cgit