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