]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rcu: Make call_rcu() leak callbacks for debug-object errors
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 23 Apr 2013 20:20:57 +0000 (13:20 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 27 May 2013 11:59:18 +0000 (04:59 -0700)
commit64852d25d4e69c7e3f21ce5ed2c1f1b6db74dcee
treef4a3e2577011e6ba364b5ecd26ae4e319d2bcf62
parentfdc992d5df2de0b45a96b69b070bd083192ef67a
rcu: Make call_rcu() leak callbacks for debug-object errors

If someone does a duplicate call_rcu(), the worst thing the second
call_rcu() could do would be to actually queue the callback the second
time because doing so corrupts whatever list the callback was already
queued on.  This commit therefore makes __call_rcu() check the new
return value from debug-objects and leak the callback upon error.
This commit also substitutes rcu_leak_callback() for whatever callback
function was previously in place in order to avoid freeing the callback
out from under any readers that might still be referencing it.

These changes increase the probability that the debug-objects error
messages will actually make it somewhere visible.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
Cc: Rik van Riel <riel@surriel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
kernel/rcu.h
kernel/rcutree.c