From 6c2db235183b1d1840dc94e9b47e98ebde422e0e Mon Sep 17 00:00:00 2001
From: Nithya Balachandran <nbalacha@redhat.com>
Date: Mon, 17 Aug 2015 14:18:43 +0530
Subject: [PATCH 273/279] 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.
backport: http://review.gluster.org/11819
Change-Id: I0c68937213f6d2bfe7221e0fb1210555226009b0
BUG: 1213893
Signed-off-by: Nithya Balachandran <nbalacha@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/55319
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Tested-by: Atin Mukherjee <amukherj@redhat.com>
---
xlators/mgmt/glusterd/src/glusterd-volgen.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 3d04e9f..d784d17 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -4224,16 +4224,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)
@@ -4263,8 +4266,7 @@ 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;
--
1.7.1