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