]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG,ReplicatedPG: clarify scrub state clearing
authorSamuel Just <sam.just@inktank.com>
Mon, 30 Jul 2012 20:43:51 +0000 (13:43 -0700)
committerSamuel Just <sam.just@inktank.com>
Mon, 30 Jul 2012 20:43:51 +0000 (13:43 -0700)
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>
src/osd/PG.cc
src/osd/ReplicatedPG.cc

index 16b118256cf6fff572723db8426d938df1068e2c..70e83c92b97a0412a5f821dcbb9b2ff10529a906 100644 (file)
@@ -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;
   }
index 684d361146b1d3097d24d7fc87502b09f8bf0b41..2effb64346c6d7791309fa2fb7ba9e594959b29a 100644 (file)
@@ -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();