[4.2.y-ckt stable] Patch "kernel/panic.c: turn off locks debug before releasing console lock" has been added to the 4.2.y-ckt tree

Kamal Mostafa kamal at canonical.com
Wed Jan 27 00:12:24 UTC 2016


This is a note to let you know that I have just added a patch titled

    kernel/panic.c: turn off locks debug before releasing console lock

to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue

This patch is scheduled to be released in version 4.2.8-ckt3.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 4.2.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

---8<------------------------------------------------------------

>From 0a50f55bd0cd2795bb7c72fe6b153015298f62ab Mon Sep 17 00:00:00 2001
From: Vitaly Kuznetsov <vkuznets at redhat.com>
Date: Fri, 20 Nov 2015 15:57:24 -0800
Subject: kernel/panic.c: turn off locks debug before releasing console lock

commit 7625b3a0007decf2b135cb47ca67abc78a7b1bc1 upstream.

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 at linux.intel.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets at redhat.com>
Cc: HATAYAMA Daisuke <d.hatayama at jp.fujitsu.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt at hitachi.com>
Cc: Jiri Kosina <jkosina at suse.cz>
Cc: Baoquan He <bhe at redhat.com>
Cc: Prarit Bhargava <prarit at redhat.com>
Cc: Xie XiuQi <xiexiuqi at huawei.com>
Cc: Seth Jennings <sjenning at redhat.com>
Cc: "K. Y. Srinivasan" <kys at microsoft.com>
Cc: Jan Kara <jack at suse.cz>
Cc: Petr Mladek <pmladek at suse.cz>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki at jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
[ kamal: 4.2-stable prereq for
  8d91f8b printk: do cond_resched() between lines while outputting to consoles ]
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 kernel/panic.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index 4579dbb..4b150bc 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -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.
 	 */
+	debug_locks_off();
 	console_trylock();
 	console_unlock();

--
1.9.1





More information about the kernel-team mailing list