path: root/xlators/features/bit-rot/src/bitd/bit-rot.c
diff options
authorKotresh HR <>2017-06-15 08:31:06 -0400
committerAtin Mukherjee <>2017-06-16 06:01:49 +0000
commitf0fb166078d59cab2a33583591b6448326247c40 (patch)
tree7b5257b04d2c5ea69f08e0a6a1c9b1751dc7b30f /xlators/features/bit-rot/src/bitd/bit-rot.c
parentb9fb7ea63d6120faaeb75ffa0cafbc0ab0e4a619 (diff)
feature/bitrot: Fix ondemand scrub
The flag which keeps tracks of whether the scrub frequency is changed from previous value should not be considered for on-demand scrubbing. It should be considered only for 'scrub-frequency' where it should not be re-scheduled if it is set to same value again. But in case ondemand scrub, it should start the scrub immediately no matter what the scrub-frequency. Reproducer: 1. Enable bitrot 2. Set scrub-throttle 3. Set ondemand scrub Make sure glusterd is not restarted while doing below steps Change-Id: Ice5feaece7fff1579fb009d1a59d2b8292e23e0b BUG: 1461845 Signed-off-by: Kotresh HR <> Reviewed-on: Smoke: Gluster Build System <> CentOS-regression: Gluster Build System <> Reviewed-by: Raghavendra Bhat <> NetBSD-regression: NetBSD Build System <>
Diffstat (limited to 'xlators/features/bit-rot/src/bitd/bit-rot.c')
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c
index 6e86ceb..c591db5 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot.c
+++ b/xlators/features/bit-rot/src/bitd/bit-rot.c
@@ -1680,8 +1680,14 @@ notify (xlator_t *this, int32_t event, void *data, ...)
gf_log (this->name, GF_LOG_INFO, "BitRot scrub ondemand "
- if (scrub_monitor->state != BR_SCRUB_STATE_PENDING)
+ if (scrub_monitor->state != BR_SCRUB_STATE_PENDING) {
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ "on demand scrub schedule failed. Scrubber is "
+ "not in pending state. Current state is %d",
+ scrub_monitor->state);
return -2;
+ }
/* Needs synchronization with reconfigure thread */
pthread_mutex_lock (&priv->lock);