summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYong Zhang <yong.zhang@windriver.com>2010-04-06 23:35:03 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2010-04-07 17:38:04 +0200
commit57119c34e53bbb8d244c3ff1335ef5145768538f (patch)
tree829858c9c167a2da60b54f85d4c620e58fe42125
parentkernel.h: fix wrong usage of __ratelimit() (diff)
downloadlinux-57119c34e53bbb8d244c3ff1335ef5145768538f.tar.xz
linux-57119c34e53bbb8d244c3ff1335ef5145768538f.zip
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>
-rw-r--r--lib/ratelimit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ratelimit.c b/lib/ratelimit.c
index b4cd24ff9b29..027a03f4c56d 100644
--- a/lib/ratelimit.c
+++ b/lib/ratelimit.c
@@ -40,7 +40,7 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func)
* the entity that is holding the lock already:
*/
if (!spin_trylock_irqsave(&rs->lock, flags))
- return 1;
+ return 0;
if (!rs->begin)
rs->begin = jiffies;