From 8f7fab2980fee3eab1dc5e782dfbbc3fa5b83b5d Mon Sep 17 00:00:00 2001 From: renweihub Date: Tue, 8 Apr 2014 15:55:46 +0800 Subject: [PATCH] Update ratelimit.c fix bug in ratelimit --- lib/ratelimit.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/ratelimit.c b/lib/ratelimit.c index 40e03ea2a967d9..5013d166bfb3e0 100644 --- a/lib/ratelimit.c +++ b/lib/ratelimit.c @@ -42,14 +42,11 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func) if (!raw_spin_trylock_irqsave(&rs->lock, flags)) return 0; - if (!rs->begin) - rs->begin = jiffies; - if (time_is_before_jiffies(rs->begin + rs->interval)) { if (rs->missed) printk(KERN_WARNING "%s: %d callbacks suppressed\n", func, rs->missed); - rs->begin = 0; + rs->begin = jiffers; rs->printed = 0; rs->missed = 0; }