]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add sanity check for scrubs_active counter
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 2 Aug 2016 05:50:18 +0000 (13:50 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 2 Aug 2016 22:21:07 +0000 (06:21 +0800)
To make sure there is no underflow and the scrub logic
works fine.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/OSD.cc

index 1970d47d7fc6f26f39a95eee8eadc7247b754cd5..b46d59b66644bad25f694e58cf656665a248ef65 100644 (file)
@@ -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();
 }