cb8e9e
From ed87ccca25f1119726b47fed6766a1403e9b18ab Mon Sep 17 00:00:00 2001
cb8e9e
From: Gaurav Kumar Garg <ggarg@redhat.com>
cb8e9e
Date: Wed, 27 May 2015 14:36:24 +0530
cb8e9e
Subject: [PATCH 24/57] bitrot/glusterd: scrub option should be disabled once bitrot option is reset
cb8e9e
cb8e9e
Scrubber options should be disabled from the dictionary if user reset
cb8e9e
bitrot option.
cb8e9e
cb8e9e
BUG: 1224161
cb8e9e
Change-Id: I2a74497dce40a17dc64367a3d3f039fb414262e1
cb8e9e
Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com>
cb8e9e
upstream-review-url: http://review.gluster.org/#/c/10936/
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/50099
cb8e9e
Reviewed-by: Venky Shankar <vshankar@redhat.com>
cb8e9e
Tested-by: Venky Shankar <vshankar@redhat.com>
cb8e9e
---
cb8e9e
 xlators/mgmt/glusterd/src/glusterd-op-sm.c      |    7 +++++++
cb8e9e
 xlators/mgmt/glusterd/src/glusterd-volume-set.c |    1 +
cb8e9e
 2 files changed, 8 insertions(+), 0 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
cb8e9e
index 9b9684e..e304cb0 100644
cb8e9e
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
cb8e9e
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
cb8e9e
@@ -1696,6 +1696,13 @@ _delete_reconfig_opt (dict_t *this, char *key, data_t *value, void *data)
cb8e9e
         gf_log ("", GF_LOG_DEBUG, "deleting dict with key=%s,value=%s",
cb8e9e
                 key, value->data);
cb8e9e
         dict_del (this, key);
cb8e9e
+        /**Delete scrubber (pause/resume) option from the dictionary if bitrot
cb8e9e
+         * option is going to be reset
cb8e9e
+         * */
cb8e9e
+        if (!strncmp (key, VKEY_FEATURES_BITROT,
cb8e9e
+             strlen (VKEY_FEATURES_BITROT))) {
cb8e9e
+                dict_del (this, VKEY_FEATURES_SCRUB);
cb8e9e
+        }
cb8e9e
 out:
cb8e9e
         return 0;
cb8e9e
 }
cb8e9e
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
cb8e9e
index 65cbfc0..9b9f544 100644
cb8e9e
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
cb8e9e
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
cb8e9e
@@ -1857,6 +1857,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
cb8e9e
           .voltype    = "features/bitrot",
cb8e9e
           .option     = "scrubber",
cb8e9e
           .op_version = GD_OP_VERSION_3_7_0,
cb8e9e
+          .flags      = OPT_FLAG_FORCE,
cb8e9e
           .type       = NO_DOC,
cb8e9e
         },
cb8e9e
         /* Upcall translator options */
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e