From: Jin Cai Date: Fri, 5 May 2017 08:29:25 +0000 (+0800) Subject: osd/OSD.cc: lock the pg only when all conditional checks are passed when X-Git-Tag: v12.0.3~67^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14968%2Fhead;p=ceph.git osd/OSD.cc: lock the pg only when all conditional checks are passed when scheduling a scrub Signed-off-by: Jin Cai --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index b196f1fba9e0..95645e805798 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -6833,11 +6833,16 @@ void OSD::sched_scrub() break; } + if ((scrub.deadline >= now) && !(time_permit && load_is_low)) { + dout(10) << __func__ << " not scheduling scrub for " << scrub.pgid << " due to " + << (!time_permit ? "time not permit" : "high load") << dendl; + continue; + } + PG *pg = _lookup_lock_pg(scrub.pgid); if (!pg) continue; - if (pg->get_pgbackend()->scrub_supported() && pg->is_active() && - (scrub.deadline < now || (time_permit && load_is_low))) { + if (pg->get_pgbackend()->scrub_supported() && pg->is_active()) { dout(10) << "sched_scrub scrubbing " << scrub.pgid << " at " << scrub.sched_time << (pg->scrubber.must_scrub ? ", explicitly requested" : (load_is_low ? ", load_is_low" : " deadline < now"))