summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2019-04-16 17:20:34 +0530
committerAtin Mukherjee <amukherj@redhat.com>2019-04-17 08:24:19 +0000
commite97aa3b36627a821af164ab292259b320993495c (patch)
tree4d6cc0b58859e036070bef82c5776f1ff60398dd /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent785f3276d2e325a991b64aed66a326ea95fffef3 (diff)
glusterd: fix loading ctime in client graph logic
Commit efbf8ab wasn't handling all the scenarios of toggling ctime option correctly and more over a ! had completely tossed up the logic. Fixes: bz#1697907 Change-Id: If12e2f69045e59878992ee2cd0518cc0eabcce0d Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 75411f9..493edb1 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -4312,9 +4312,15 @@ client_graph_builder(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
goto out;
}
}
-
- if (conf->op_version >= GD_OP_VERSION_5_0 &&
- !dict_get_str_boolean(set_dict, "features.ctime", _gf_false)) {
+ /* a. ret will be -1 if features.ctime is not set in the volinfo->dict which
+ * means ctime should be loaded into the graph.
+ * b. ret will be 1 if features.ctime is explicitly turned on through
+ * volume set and in that case ctime should be loaded into the graph.
+ * c. ret will be 0 if features.ctime is explicitly turned off and in that
+ * case ctime shouldn't be loaded into the graph.
+ */
+ ret = dict_get_str_boolean(set_dict, "features.ctime", -1);
+ if (conf->op_version >= GD_OP_VERSION_5_0 && ret) {
xl = volgen_graph_add(graph, "features/utime", volname);
if (!xl) {
ret = -1;