Commit 256a6b41 authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds
Browse files

[PATCH] lockdep: fix printk recursion logic

Bug reported and fixed by Tilman Schmidt <>: if lockdep is
enabled then log messages make it to /var/log/messages belatedly.  The
reason is a missed wakeup of klogd.

Initially there was only a lockdep_internal() protection against lockdep
recursion within vprintk() - it grew the 'outer' lockdep_off()/on()
protection only later on.  But that lockdep_off() made the
release_console_sem() within vprintk() always happen under the
lockdep_internal() condition, causing the bug.

The right solution to remove the inner protection against recursion here -
the outer one is enough.
Signed-off-by: default avatarIngo Molnar <>
Cc: Tilman Schmidt <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 5fcce743
......@@ -820,15 +820,8 @@ void release_console_sem(void)
console_locked = 0;
spin_unlock_irqrestore(&logbuf_lock, flags);
if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait)) {
* If we printk from within the lock dependency code,
* from within the scheduler code, then do not lock
* up due to self-recursion:
if (!lockdep_internal())
if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment