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