From: Yong Zhang Date: Tue, 6 Apr 2010 21:35:03 +0000 (-0700) Subject: ratelimit: fix the return value when __ratelimit() fails to acquire the lock X-Git-Tag: v2.6.34-rc4~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57119c34e53bbb8d244c3ff1335ef5145768538f;p=platform%2Fkernel%2Flinux-3.10.git 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 Cc: Ingo Molnar Cc: Christian Borntraeger Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/ratelimit.c b/lib/ratelimit.c index b4cd24f..027a03f 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;