summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2015-08-14 10:15:25 +0530
committerAtin Mukherjee <amukherj@redhat.com>2015-08-17 00:17:15 -0700
commitcfefaaed76c72fd2ee142217b4de55a2c7518ba7 (patch)
tree5c17e5b0233b25cef66f86cb5bf1d3e18fe51be0 /xlators/mgmt/glusterd/src/glusterd-volgen.c
parentf54594753ccecf43b1d501a24374cad18e244127 (diff)
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 <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/11819 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> (cherry picked from commit 8603ac80218d6161416fd0f3cca511ba09aef2c8) Signed-off-by: Nithya Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/11915
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c20
1 files changed, 11 insertions, 9 deletions
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,