From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968435AbcA0VWy (ORCPT ); Wed, 27 Jan 2016 16:22:54 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:43293 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161166AbcA0Ui4 (ORCPT ); Wed, 27 Jan 2016 15:38:56 -0500 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Vitaly Kuznetsov , HATAYAMA Daisuke , Masami Hiramatsu , Jiri Kosina , Baoquan He , Prarit Bhargava , Xie XiuQi , Seth Jennings , "K. Y. Srinivasan" , Jan Kara , Petr Mladek , Yasuaki Ishimatsu , Andrew Morton , Linus Torvalds , Kamal Mostafa Subject: [PATCH 4.2.y-ckt 145/268] kernel/panic.c: turn off locks debug before releasing console lock Date: Wed, 27 Jan 2016 12:33:26 -0800 Message-Id: <1453926929-17663-146-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453926929-17663-1-git-send-email-kamal@canonical.com> References: <1453926929-17663-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 4.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.2.8-ckt3 -stable review patch. If anyone has any objections, please let me know. ---8<------------------------------------------------------------ From: Vitaly Kuznetsov 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 Signed-off-by: Vitaly Kuznetsov Cc: HATAYAMA Daisuke Cc: Masami Hiramatsu Cc: Jiri Kosina Cc: Baoquan He Cc: Prarit Bhargava Cc: Xie XiuQi Cc: Seth Jennings Cc: "K. Y. Srinivasan" Cc: Jan Kara Cc: Petr Mladek Cc: Yasuaki Ishimatsu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds [ kamal: 4.2-stable prereq for 8d91f8b printk: do cond_resched() between lines while outputting to consoles ] Signed-off-by: Kamal Mostafa --- 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