]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
TokenBucketThrottle: Init the remain with max when we want to set_max and the max...
authorDongsheng Yang <dongsheng.yang@easystack.cn>
Tue, 12 Jun 2018 02:36:40 +0000 (22:36 -0400)
committerDongsheng Yang <dongsheng.yang@easystack.cn>
Thu, 14 Jun 2018 02:47:24 +0000 (22:47 -0400)
Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
src/common/Throttle.cc

index 1e9aed5d36ba8dd18586af52279e0d0baf5c9048..877ace344f1d9b37d8fda1e0b0427941d3d616fd 100644 (file)
@@ -685,7 +685,7 @@ uint64_t TokenBucketThrottle::Bucket::put(uint64_t c) {
 }
 
 void TokenBucketThrottle::Bucket::set_max(uint64_t m) {
-  if (remain > m)
+  if (remain > m || max == 0)
     remain = m;
   max = m;
 }