|author||Vitaly Kuznetsov <firstname.lastname@example.org>||2015-11-20 15:57:24 -0800|
|committer||Linus Torvalds <email@example.com>||2015-11-20 16:17:32 -0800|
kernel/panic.c: turn off locks debug before releasing console lock
Commit 08d78658f393 ("panic: release stale console lock to always get the logbuf printed out") introduced an unwanted bad unlock balance report when panic() is called directly and not from OOPS (e.g. from out_of_memory()). The difference is that in case of OOPS we disable locks debug in oops_enter() and on direct panic call nobody does that. Fixes: 08d78658f393 ("panic: release stale console lock to always get the logbuf printed out") Reported-by: kernel test robot <firstname.lastname@example.org> Signed-off-by: Vitaly Kuznetsov <email@example.com> Cc: HATAYAMA Daisuke <firstname.lastname@example.org> Cc: Masami Hiramatsu <email@example.com> Cc: Jiri Kosina <firstname.lastname@example.org> Cc: Baoquan He <email@example.com> Cc: Prarit Bhargava <firstname.lastname@example.org> Cc: Xie XiuQi <email@example.com> Cc: Seth Jennings <firstname.lastname@example.org> Cc: "K. Y. Srinivasan" <email@example.com> Cc: Jan Kara <firstname.lastname@example.org> Cc: Petr Mladek <email@example.com> Cc: Yasuaki Ishimatsu <firstname.lastname@example.org> Signed-off-by: Andrew Morton <email@example.com> Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index 4579dbb7ed87..4b150bc0c6c1 100644
@@ -152,8 +152,11 @@ void panic(const char *fmt, ...)
* We may have ended up stopping the CPU holding the lock (in
* smp_send_stop()) while still having some valuable data in the console
* buffer. Try to acquire the lock then release it regardless of the
- * result. The release will also print the buffers out.
+ * result. The release will also print the buffers out. Locks debug
+ * should be disabled to avoid reporting bad unlock balance when
+ * panic() is not being callled from OOPS.