diff options
-rw-r--r-- | lib/ratelimit.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ratelimit.c b/lib/ratelimit.c index 90c9fe57eb42..7a7ba4835639 100644 --- a/lib/ratelimit.c +++ b/lib/ratelimit.c @@ -35,8 +35,12 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func) unsigned long flags; int ret; - if (!interval) - return 1; + if (interval <= 0 || burst <= 0) { + ret = interval == 0 || burst > 0; + if (!ret) + ratelimit_state_inc_miss(rs); + return ret; + } /* * If we contend on this state's lock then just check if |