scrub_clear_state takes care of clearing the SCRUB and REPAIR
flags. Thus, PG::scrub() needn't clear them again since
any change that would have caused that if block to occur
would have triggered ReplicatedPG::on_change(), which also
clears the scrub reservations.
Signed-off-by: Samuel Just <sam.just@inktank.com>
if (!is_primary() || !is_active() || !is_clean() || !is_scrubbing()) {
dout(10) << "scrub -- not primary or active or not clean" << dendl;
- state_clear(PG_STATE_REPAIR);
- state_clear(PG_STATE_SCRUBBING);
- clear_scrub_reserved();
unlock();
return;
}
dout(10) << "on_change" << dendl;
apply_and_flush_repops(is_primary());
- // clear reserved scrub state
clear_scrub_reserved();
-
- // clear scrub state
- if (scrub_block_writes) {
- scrub_clear_state();
- } else if (is_scrubbing()) {
- state_clear(PG_STATE_SCRUBBING);
- state_clear(PG_STATE_REPAIR);
- }
+ scrub_clear_state();
context_registry_on_change();