diff options
author | Vitaly Kuznetsov <vkuznets@redhat.com> | 2015-11-20 18:57:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-20 19:17:32 -0500 |
commit | 7625b3a0007decf2b135cb47ca67abc78a7b1bc1 (patch) | |
tree | 4aa040716e9f30f2a45d08c57b2417a4c103bdcb | |
parent | 9d8a765211335cfdad464b90fb19f546af5706ae (diff) |
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 <ying.huang@linux.intel.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Baoquan He <bhe@redhat.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Xie XiuQi <xiexiuqi@huawei.com>
Cc: Seth Jennings <sjenning@redhat.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Petr Mladek <pmladek@suse.cz>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/panic.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index 4579dbb7ed87..4b150bc0c6c1 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
@@ -152,8 +152,11 @@ void panic(const char *fmt, ...) | |||
152 | * We may have ended up stopping the CPU holding the lock (in | 152 | * We may have ended up stopping the CPU holding the lock (in |
153 | * smp_send_stop()) while still having some valuable data in the console | 153 | * smp_send_stop()) while still having some valuable data in the console |
154 | * buffer. Try to acquire the lock then release it regardless of the | 154 | * buffer. Try to acquire the lock then release it regardless of the |
155 | * result. The release will also print the buffers out. | 155 | * result. The release will also print the buffers out. Locks debug |
156 | * should be disabled to avoid reporting bad unlock balance when | ||
157 | * panic() is not being callled from OOPS. | ||
156 | */ | 158 | */ |
159 | debug_locks_off(); | ||
157 | console_trylock(); | 160 | console_trylock(); |
158 | console_unlock(); | 161 | console_unlock(); |
159 | 162 | ||