]> git.baikalelectronics.ru Git - kernel.git/commit
Fix locking bug in "acquire_console_semaphore_for_printk()"
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Apr 2008 20:09:54 +0000 (13:09 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Apr 2008 20:09:54 +0000 (13:09 -0700)
commitec5f054e3a9bf2e866e5200d23d436ca746e0469
treebaaa4d86680347a0687ebfbe133d7b253b88102c
parent4bdd99529d277f81965a9b30fe03080f09e32634
Fix locking bug in "acquire_console_semaphore_for_printk()"

When I cleaned up printk() and split up the printk locking logic in
commit e3242c1b8227a79ee5ed00131abe0b5a5dad8ff1 ("Make printk() console
semaphore accesses sensible") I had incorrectly moved the call to
have_callable_console() outside of the console semaphore.

That was buggy.  The console semaphore protects the console_drivers list
that is used by have_callable_console().

Thanks go to Bongani Hlope who saw this as a hang on shutdown and reboot
and bisected the bug to the right commit, and tested this patch. See

http://lkml.org/lkml/2008/4/11/315

Bisected-and-tested-by: Bongani Hlope <bonganilinux@mweb.co.za>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/printk.c