projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c193c82
)
printk: avoid double lock acquire
author
Peter Zijlstra
<
[email protected]
>
Thu, 8 Dec 2011 22:34:13 +0000
(14:34 -0800)
committer
Linus Torvalds
<
[email protected]
>
Fri, 9 Dec 2011 15:50:28 +0000
(07:50 -0800)
Commit
4f2a8d3cf5e
("printk: Fix console_sem vs logbuf_lock unlock race")
introduced another silly bug where we would want to acquire an already
held lock. Avoid this.
Reported-by: Andrea Arcangeli <
[email protected]
>
Signed-off-by: Peter Zijlstra <
[email protected]
>
Cc: Ingo Molnar <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
kernel/printk.c
patch
|
blob
|
history
diff --git
a/kernel/printk.c
b/kernel/printk.c
index 1455a0d4eedd4b386c759d689f939ba5d7a9007a..7982a0a841eaf082fe929e24a1f4bd5aefd4f015 100644
(file)
--- a/
kernel/printk.c
+++ b/
kernel/printk.c
@@
-1293,10
+1293,11
@@
again:
raw_spin_lock(&logbuf_lock);
if (con_start != log_end)
retry = 1;
+ raw_spin_unlock_irqrestore(&logbuf_lock, flags);
+
if (retry && console_trylock())
goto again;
- raw_spin_unlock_irqrestore(&logbuf_lock, flags);
if (wake_klogd)
wake_up_klogd();
}