From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: Re: [PATCH] list_bl: fix oops on UP with DEBUG_SPINLOCK Date: Fri, 14 Jan 2011 23:20:12 +1100 Message-ID: References: <1295007399-7279-1-git-send-email-kas@openvz.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Nick Piggin , "Paul E. McKenney" , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: "Kirill A. Shutemov" Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:65464 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752160Ab1ANMUO convert rfc822-to-8bit (ORCPT ); Fri, 14 Jan 2011 07:20:14 -0500 In-Reply-To: <1295007399-7279-1-git-send-email-kas@openvz.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Jan 14, 2011 at 11:16 PM, Kirill A. Shutemov w= rote: > This patch partly reverts 2c6755988a. > > spin_[un]lock_bucket() uses bit_spin_[un]lock() to set/clear first > bit of ->head.first. bit_spin_[un]lock() touches the bit on UP if > DEBUG_SPINLOCK enabled. > > So we have to define LIST_BL_LOCKMASK to 1, if DEBUG_SPINLOCK enabled= =2E > Other way is reimplementation of spin_[un]lock_bucket(). > > [ =A0 =A00.140008] BUG: unable to handle kernel NULL pointer derefere= nce at 00000005 > [ =A0 =A00.140008] IP: [] __d_rehash+0x6f/0xc0 > [ =A0 =A00.140008] *pde =3D 00000000 > [ =A0 =A00.140008] Oops: 0002 [#1] > [ =A0 =A00.140008] last sysfs file: > [ =A0 =A00.140008] Modules linked in: > [ =A0 =A00.140008] > [ =A0 =A00.140008] Pid: 1, comm: swapper Not tainted 2.6.37+ #150 /Bo= chs > [ =A0 =A00.140008] EIP: 0060:[] EFLAGS: 00010202 CPU: 0 > [ =A0 =A00.140008] EIP is at __d_rehash+0x6f/0xc0 > [ =A0 =A00.140008] EAX: 00000022 EBX: c7402460 ECX: 00000000 EDX: c74= 02468 > [ =A0 =A00.140008] ESI: c7ee157c EDI: 00000001 EBP: c782bedc ESP: c78= 2bec4 > [ =A0 =A00.140008] =A0DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 > [ =A0 =A00.140008] Process swapper (pid: 1, ti=3Dc782a000 task=3Dc783= 0000 task.ti=3Dc782a000) > [ =A0 =A00.140008] Stack: > [ =A0 =A00.140008] =A0c13b698f 00000001 c7402468 02eef038 c7402460 c7= 402460 c782bee8 c10a7d69 > [ =A0 =A00.140008] =A0c74024b0 c782bef8 c10a7d90 c7402460 c7400430 c7= 82bf04 c10b32f4 c1304380 > [ =A0 =A00.140008] =A0c782bf1c c109dcd2 00000000 00000000 c74023c0 c7= 400430 c782bf3c c109df85 > [ =A0 =A00.140008] Call Trace: > [ =A0 =A00.140008] =A0[] _d_rehash+0x39/0x40 > [ =A0 =A00.140008] =A0[] d_rehash+0x20/0x40 > [ =A0 =A00.140008] =A0[] simple_lookup+0x34/0x40 > [ =A0 =A00.140008] =A0[] d_alloc_and_lookup+0x32/0x60 > [ =A0 =A00.140008] =A0[] __lookup_hash+0xc5/0x160 > [ =A0 =A00.140008] =A0[] lookup_one_len+0x8e/0xe0 > [ =A0 =A00.140008] =A0[] debugfs_create_file+0x77/0x200 > [ =A0 =A00.140008] =A0[] ? __class_create+0x29/0x80 > [ =A0 =A00.140008] =A0[] ? kernel_init+0x0/0x120 > [ =A0 =A00.140008] =A0[] debugfs_create_dir+0x21/0x30 > [ =A0 =A00.140008] =A0[] bdi_class_init+0x33/0x3c > [ =A0 =A00.140008] =A0[] do_one_initcall+0x30/0x160 > [ =A0 =A00.140008] =A0[] ? bdi_class_init+0x0/0x3c > [ =A0 =A00.140008] =A0[] ? kernel_init+0x0/0x120 > [ =A0 =A00.140008] =A0[] kernel_init+0x8c/0x120 > [ =A0 =A00.140008] =A0[] kernel_thread_helper+0x6/0x10 > [ =A0 =A00.140008] Code: 9e d0 3d c1 e8 19 14 25 00 8b 3e 8d 53 08 89= 55 f0 89 7c 24 04 c7 04 24 8f 69 3b c1 e8 01 14 25 00 85 ff 8b 55 f0 8= 9 7b 08 74 03 <89> 57 04 89 73 0c 89 16 c7 04 24 6c dc 3d c1 e8 e3 13 2= 5 00 8b > [ =A0 =A00.140008] EIP: [] __d_rehash+0x6f/0xc0 SS:ESP 0068= :c782bec4 > [ =A0 =A00.140008] CR2: 0000000000000005 > [ =A0 =A00.144008] ---[ end trace 4eaa2a86a8e2da22 ]--- > > Signed-off-by: Kirill A. Shutemov > --- > =A0include/linux/list_bl.h | =A0 =A02 +- > =A01 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/include/linux/list_bl.h b/include/linux/list_bl.h > index b2adbb4..5bad17d 100644 > --- a/include/linux/list_bl.h > +++ b/include/linux/list_bl.h > @@ -16,7 +16,7 @@ > =A0* some fast and compact auxiliary data. > =A0*/ > > -#if defined(CONFIG_SMP) > +#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) > =A0#define LIST_BL_LOCKMASK =A0 =A0 =A0 1UL > =A0#else > =A0#define LIST_BL_LOCKMASK =A0 =A0 =A0 0UL Thank you. Russell reported this too. I need a brown paper bag... -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html