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