From: Samuel Just Date: Mon, 30 Jul 2012 20:43:51 +0000 (-0700) Subject: PG,ReplicatedPG: clarify scrub state clearing X-Git-Tag: v0.51~54 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cda5e8e0c3ba71c66b5bf3f71d21d032de7c8d9f;p=ceph.git PG,ReplicatedPG: clarify scrub state clearing 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 --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 16b118256cf6..70e83c92b97a 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -3119,9 +3119,6 @@ void PG::scrub() 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; } diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 684d361146b1..2effb64346c6 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5767,16 +5767,8 @@ void ReplicatedPG::on_change() 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();