lkml.org 
[lkml]   [2011]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[RFC][PATCH v3 3/3]skip subsequent kmsg_dump() function calls in panic path
This patch skips subsequent kmsg_dump() function calls in panic path

With this patch, we can avoid deadlock due to the subsequent calls.
Actually, kmsg_dump(KMSG_DUMP_EMERG) is called after kmsg_dump(KMSG_DUMP_PANIC)
when panic_timeout variable is set.

Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>

---
kernel/printk.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index bc5ac61..25d6dc1 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1731,6 +1731,16 @@ void kmsg_dump(enum kmsg_dump_reason reason)
const char *s1, *s2;
unsigned long l1, l2;
unsigned long flags;
+ static bool panicked;
+
+ /*
+ * kmsg_dump() is skipped because we already got panic log.
+ */
+ if (panicked)
+ return;
+
+ if (reason == KMSG_DUMP_PANIC)
+ panicked = true;

WARN_ON(in_nmi() && reason != KMSG_DUMP_PANIC);

--
1.7.1



\
 
 \ /
  Last update: 2011-12-02 23:17    [W:0.025 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site