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