256ebe
From f1f27e5839dd99389bef65f79ea491e98e6935d2 Mon Sep 17 00:00:00 2001
256ebe
From: Ravishankar N <ravishankar@redhat.com>
256ebe
Date: Tue, 23 Apr 2019 18:05:36 +0530
256ebe
Subject: [PATCH 133/141] glusterd: enable fips-mode-rchecksum for new volumes
256ebe
256ebe
...during volume create if the cluster op-version is >=GD_OP_VERSION_7_0.
256ebe
256ebe
This option itself was introduced in GD_OP_VERSION_4_0_0 via commit 6daa65356.
256ebe
We missed enabling it by default for new volume creates in that commit.
256ebe
If we are to do it now safely, we need to use op version
256ebe
GD_OP_VERSION_7_0 and target it for release-7.
256ebe
256ebe
Patch in upstream master: https://review.gluster.org/#/c/glusterfs/+/22609/
256ebe
BUG: 1706683
256ebe
Change-Id: I7c6d4a8abe0816367e7069cb5cad01744f04858f
256ebe
fixes: bz#1706683
256ebe
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
256ebe
Reviewed-on: https://code.engineering.redhat.com/gerrit/169443
256ebe
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
256ebe
Tested-by: RHGS Build Bot <nigelb@redhat.com>
256ebe
---
256ebe
 xlators/mgmt/glusterd/src/glusterd-volgen.c | 13 +++++++++++++
256ebe
 1 file changed, 13 insertions(+)
256ebe
256ebe
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
256ebe
index da877aa..77aa705 100644
256ebe
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
256ebe
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
256ebe
@@ -1614,10 +1614,17 @@ brick_graph_add_posix(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
256ebe
     gf_boolean_t pgfid_feat = _gf_false;
256ebe
     char *value = NULL;
256ebe
     xlator_t *xl = NULL;
256ebe
+    xlator_t *this = NULL;
256ebe
+    glusterd_conf_t *priv = NULL;
256ebe
 
256ebe
     if (!graph || !volinfo || !set_dict || !brickinfo)
256ebe
         goto out;
256ebe
 
256ebe
+    this = THIS;
256ebe
+    GF_VALIDATE_OR_GOTO("glusterd", this, out);
256ebe
+    priv = this->private;
256ebe
+    GF_VALIDATE_OR_GOTO("glusterd", priv, out);
256ebe
+
256ebe
     ret = glusterd_volinfo_get(volinfo, VKEY_FEATURES_QUOTA, &value);
256ebe
     if (value) {
256ebe
         ret = gf_string2boolean(value, &quota_enabled);
256ebe
@@ -1661,6 +1668,12 @@ brick_graph_add_posix(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
256ebe
         }
256ebe
     }
256ebe
 
256ebe
+    if (priv->op_version >= GD_OP_VERSION_7_0) {
256ebe
+        ret = xlator_set_fixed_option(xl, "fips-mode-rchecksum", "on");
256ebe
+        if (ret) {
256ebe
+            goto out;
256ebe
+        }
256ebe
+    }
256ebe
     snprintf(tmpstr, sizeof(tmpstr), "%d", brickinfo->fs_share_count);
256ebe
     ret = xlator_set_fixed_option(xl, "shared-brick-count", tmpstr);
256ebe
 out:
256ebe
-- 
256ebe
1.8.3.1
256ebe