Commit 57119c34e53bbb8d244c3ff1335ef5145768538f

Authored by Yong Zhang
Committed by Linus Torvalds
1 parent bb1dc0bacb

ratelimit: fix the return value when __ratelimit() fails to acquire the lock

The log of commit edaac8e3167501cda336231d00611bf59c164346 ("ratelimit:
Fix/allow use in atomic contexts"), indicates that we want to suppress the
callback when the trylock fails.

Signed-off-by: Yong Zhang <yong.zhang@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -40,7 +40,7 @@
40 40 * the entity that is holding the lock already:
41 41 */
42 42 if (!spin_trylock_irqsave(&rs->lock, flags))
43   - return 1;
  43 + return 0;
44 44  
45 45 if (!rs->begin)
46 46 rs->begin = jiffies;