From: xie xingguo Date: Tue, 2 Aug 2016 05:50:18 +0000 (+0800) Subject: osd: add sanity check for scrubs_active counter X-Git-Tag: ses5-milestone5~180^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=41b4c7a42d9b9696378008cf7f4918b6eaa3b218;p=ceph.git osd: add sanity check for scrubs_active counter To make sure there is no underflow and the scrub logic works fine. Signed-off-by: xie xingguo --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 1970d47d7fc6..b46d59b66644 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1115,6 +1115,7 @@ void OSDService::dec_scrubs_active() dout(20) << "dec_scrubs_active " << scrubs_active << " -> " << (scrubs_active-1) << " (max " << cct->_conf->osd_max_scrubs << ", pending " << scrubs_pending << ")" << dendl; --scrubs_active; + assert(scrubs_active >= 0); sched_scrub_lock.Unlock(); }