]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Arrange code so that it is clearer should not cause any change
authorDavid Zafman <dzafman@redhat.com>
Thu, 23 Jul 2020 16:40:54 +0000 (09:40 -0700)
committerDavid Zafman <dzafman@redhat.com>
Fri, 24 Jul 2020 18:46:27 +0000 (11:46 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit ef9ab850d87a84ce42c2c8df1c9b502b2fb04989)

src/osd/OSD.cc

index 8cc4a5bb9f2ade3603d556621294d43a03a07866..3cb99c685bd78dc5b4d11d1ec8c2abc2a4378df9 100644 (file)
@@ -7926,16 +7926,15 @@ void OSD::sched_scrub()
     return;
   }
   bool allow_requested_repair_only = false;
-  if (service.is_recovery_active()) {
-    if (!cct->_conf->osd_scrub_during_recovery && cct->_conf->osd_repair_during_recovery) {
-      dout(10) << __func__
-               << " will only schedule explicitly requested repair due to active recovery"
-               << dendl;
-      allow_requested_repair_only = true;
-    } else if (!cct->_conf->osd_scrub_during_recovery && !cct->_conf->osd_repair_during_recovery) {
+  if (service.is_recovery_active() && !cct->_conf->osd_scrub_during_recovery) {
+    if (!cct->_conf->osd_repair_during_recovery) {
       dout(20) << __func__ << " not scheduling scrubs due to active recovery" << dendl;
       return;
     }
+    dout(10) << __func__
+             << " will only schedule explicitly requested repair due to active recovery"
+             << dendl;
+    allow_requested_repair_only = true;
   }
 
   utime_t now = ceph_clock_now();