]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
throttle: fix off by one issue
authorYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 27 Mar 2012 23:27:26 +0000 (16:27 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Tue, 27 Mar 2012 23:27:26 +0000 (16:27 -0700)
We were blocking only if we exceeded max count, not if
we reached it.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
src/common/Throttle.h

index 58f5f2ed49e7f716631d468fc402088ba1ceb52d..621f4a7f02a3638bae0a7eef255d43ccb19ffe0b 100644 (file)
@@ -32,7 +32,7 @@ private:
   bool _should_wait(int64_t c) {
     return
       max &&
-      ((c < max && count + c > max) ||   // normally stay under max
+      ((c <= max && count + c > max) ||   // normally stay under max
        (c >= max && count > max));       // except for large c
   }