14f8ab
From 310e09d46cdb293e4af2df0085b8ac45d5c17933 Mon Sep 17 00:00:00 2001
14f8ab
From: Atin Mukherjee <amukherj@redhat.com>
14f8ab
Date: Tue, 16 Apr 2019 17:20:34 +0530
14f8ab
Subject: [PATCH 111/124] glusterd: fix loading ctime in client graph logic
14f8ab
14f8ab
Commit efbf8ab wasn't handling all the scenarios of toggling ctime
14f8ab
option correctly and more over a ! had completely tossed up the logic.
14f8ab
14f8ab
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/22578/
14f8ab
14f8ab
>Fixes: bz#1697907
14f8ab
>Change-Id: If12e2f69045e59878992ee2cd0518cc0eabcce0d
14f8ab
>Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
14f8ab
14f8ab
BUG: 1697820
14f8ab
Change-Id: If12e2f69045e59878992ee2cd0518cc0eabcce0d
14f8ab
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
14f8ab
Reviewed-on: https://code.engineering.redhat.com/gerrit/168048
14f8ab
Tested-by: RHGS Build Bot <nigelb@redhat.com>
14f8ab
---
14f8ab
 xlators/mgmt/glusterd/src/glusterd-volgen.c | 12 +++++++++---
14f8ab
 1 file changed, 9 insertions(+), 3 deletions(-)
14f8ab
14f8ab
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
14f8ab
index 324ec2f..da877aa 100644
14f8ab
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
14f8ab
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
14f8ab
@@ -4358,9 +4358,15 @@ client_graph_builder(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
14f8ab
             goto out;
14f8ab
         }
14f8ab
     }
14f8ab
-
14f8ab
-    if (conf->op_version >= GD_OP_VERSION_5_0 &&
14f8ab
-        !dict_get_str_boolean(set_dict, "features.ctime", _gf_false)) {
14f8ab
+    /* a. ret will be -1 if features.ctime is not set in the volinfo->dict which
14f8ab
+     * means ctime should be loaded into the graph.
14f8ab
+     * b. ret will be 1 if features.ctime is explicitly turned on through
14f8ab
+     * volume set and in that case ctime should be loaded into the graph.
14f8ab
+     * c. ret will be 0 if features.ctime is explicitly turned off and in that
14f8ab
+     * case ctime shouldn't be loaded into the graph.
14f8ab
+     */
14f8ab
+    ret = dict_get_str_boolean(set_dict, "features.ctime", -1);
14f8ab
+    if (conf->op_version >= GD_OP_VERSION_5_0 && ret) {
14f8ab
         xl = volgen_graph_add(graph, "features/utime", volname);
14f8ab
         if (!xl) {
14f8ab
             ret = -1;
14f8ab
-- 
14f8ab
1.8.3.1
14f8ab