From 8603ac80218d6161416fd0f3cca511ba09aef2c8 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Mon, 3 Aug 2015 13:57:37 +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: 1248415 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 --- 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 f89a5302315..59bc0638608 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -4212,16 +4212,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) @@ -4251,13 +4254,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