From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cantor2.suse.de ([195.135.220.15]:60467 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751142AbaE0MOQ (ORCPT ); Tue, 27 May 2014 08:14:16 -0400 Message-ID: <53848193.9090709@suse.com> Date: Tue, 27 May 2014 08:14:11 -0400 From: Jeff Mahoney MIME-Version: 1.0 To: dsterba@suse.cz, linux-btrfs , Chris Mason Subject: Re: [PATCH v3] btrfs: allocate raid type kobjects dynamically References: <5383EBE0.2000906@suse.com> <20140527112604.GJ5346@suse.cz> In-Reply-To: <20140527112604.GJ5346@suse.cz> Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-btrfs-owner@vger.kernel.org List-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 5/27/14, 7:26 AM, David Sterba wrote: > A different lockdep chain, from test btrfs/014: Are you sure this one was with the new patch? We shouldn't be holding groups_sem anymore in btrfs_remove_block_group while performing the kobject ops. - -Jeff > [ 229.850151] > ====================================================== [ > 229.850788] [ INFO: possible circular locking dependency detected > ] [ 229.850788] 3.15.0-rc7-default+ #146 Tainted: G W [ > 229.850788] > ------------------------------------------------------- [ > 229.850788] btrfs/26558 is trying to acquire lock: [ 229.850788] > (s_active#149){++++.+}, at: [] > kernfs_remove+0x27/0x40 [ 229.850788] [ 229.850788] but task is > already holding lock: [ 229.850788] (&found->groups_sem){++++..}, > at: [] btrfs_remove_block_group+0x24e/0x580 > [btrfs] [ 229.850788] [ 229.850788] which lock already depends on > the new lock. [ 229.850788] [ 229.850788] [ 229.850788] the > existing dependency chain (in reverse order) is: [ 229.850788] -> > #1 (&found->groups_sem){++++..}: [ 229.850788] > [] lock_acquire+0x92/0x120 [ 229.850788] > [] down_read+0x4c/0xa0 [ 229.850788] > [] raid_bytes_show+0x3e/0xd0 [btrfs] [ > 229.850788] [] kobj_attr_show+0x16/0x20 [ > 229.850788] [] > sysfs_kf_seq_show+0xd9/0x230 [ 229.850788] > [] kernfs_seq_show+0x26/0x30 [ 229.850788] > [] seq_read+0xef/0x410 [ 229.850788] > [] kernfs_fop_read+0x125/0x180 [ 229.850788] > [] vfs_read+0xb4/0x180 [ 229.850788] > [] SyS_read+0x59/0xd0 [ 229.850788] > [] system_call_fastpath+0x16/0x1b [ 229.850788] > -> #0 (s_active#149){++++.+}: [ 229.850788] > [] __lock_acquire+0x1c4c/0x1fa0 [ 229.850788] > [] lock_acquire+0x92/0x120 [ 229.850788] > [] __kernfs_remove+0x2b7/0x380 [ 229.850788] > [] kernfs_remove+0x27/0x40 [ 229.850788] > [] sysfs_remove_dir+0x5a/0x90 [ 229.850788] > [] kobject_del+0x18/0x90 [ 229.850788] > [] btrfs_remove_block_group+0x442/0x580 [btrfs] [ > 229.850788] [] > btrfs_relocate_chunk+0x624/0x770 [btrfs] [ 229.850788] > [] btrfs_balance+0x902/0xf50 [btrfs] [ > 229.850788] [] > btrfs_ioctl_balance+0x1e0/0x350 [btrfs] [ 229.850788] > [] btrfs_ioctl+0xc39/0x1830 [btrfs] [ > 229.850788] [] do_vfs_ioctl+0x91/0x560 [ > 229.850788] [] SyS_ioctl+0x53/0x80 [ > 229.850788] [] > system_call_fastpath+0x16/0x1b [ 229.850788] [ 229.850788] other > info that might help us debug this: [ 229.850788] [ 229.850788] > Possible unsafe locking scenario: [ 229.850788] [ 229.850788] > CPU0 CPU1 [ 229.850788] ---- > ---- [ 229.850788] lock(&found->groups_sem); [ 229.850788] > lock(s_active#149); [ 229.850788] > lock(&found->groups_sem); [ 229.850788] lock(s_active#149); [ > 229.850788] [ 229.850788] *** DEADLOCK *** [ 229.850788] [ > 229.850788] 5 locks held by btrfs/26558: [ 229.850788] #0: > (sb_writers#11){.+.+.+}, at: [] > mnt_want_write_file+0x28/0x60 [ 229.850788] #1: > (&fs_info->volume_mutex){+.+.+.}, at: [] > btrfs_ioctl_balance+0x131/0x350 [btrfs] [ 229.850788] #2: > (sb_internal){.+.+..}, at: [] > start_transaction+0x456/0x550 [btrfs] [ 229.850788] #3: > (&fs_info->chunk_mutex){+.+...}, at: [] > lock_chunks+0x1e/0x20 [btrfs] [ 229.850788] #4: > (&found->groups_sem){++++..}, at: [] > btrfs_remove_block_group+0x24e/0x580 [btrfs] [ 229.850788] [ > 229.850788] stack backtrace: [ 229.850788] CPU: 1 PID: 26558 Comm: > btrfs Tainted: G W 3.15.0-rc7-default+ #146 [ > 229.850788] Hardware name: Intel Corporation Santa Rosa > platform/Matanzas, BIOS TSRSCRB1.86C.0047.B00.0610170821 10/17/06 [ > 229.850788] ffffffff8281faf0 ffff8800652a1818 ffffffff81a07898 > 0000000000000001 [ 229.850788] ffffffff82827310 ffff8800652a1868 > ffffffff810acb74 00000000001d4500 [ 229.850788] ffff8800652a18e8 > 0000000000000004 ffff880075e0ac78 0000000000000004 [ 229.850788] > Call Trace: [ 229.850788] [] > dump_stack+0x51/0x71 [ 229.850788] [] > print_circular_bug+0x214/0x310 [ 229.850788] [] > __lock_acquire+0x1c4c/0x1fa0 [ 229.850788] [] ? > kernfs_remove+0x27/0x40 [ 229.850788] [] > lock_acquire+0x92/0x120 [ 229.850788] [] ? > kernfs_remove+0x27/0x40 [ 229.850788] [] ? > mutex_unlock+0x9/0x10 [ 229.850788] [] > __kernfs_remove+0x2b7/0x380 [ 229.850788] [] ? > kernfs_remove+0x27/0x40 [ 229.850788] [] ? > kernfs_remove+0x1f/0x40 [ 229.850788] [] > kernfs_remove+0x27/0x40 [ 229.850788] [] > sysfs_remove_dir+0x5a/0x90 [ 229.850788] [] > kobject_del+0x18/0x90 [ 229.850788] [] > btrfs_remove_block_group+0x442/0x580 [btrfs] [ 229.850788] > [] ? trace_hardirqs_on_caller+0x11d/0x1e0 [ > 229.850788] [] btrfs_relocate_chunk+0x624/0x770 > [btrfs] [ 229.850788] [] ? > release_extent_buffer+0x36/0xe0 [btrfs] [ 229.850788] > [] ? free_extent_buffer+0x4a/0xc0 [btrfs] [ > 229.850788] [] ? free_extent_buffer+0x60/0xc0 > [btrfs] [ 229.850788] [] > btrfs_balance+0x902/0xf50 [btrfs] [ 229.850788] > [] ? btrfs_ioctl_balance+0x1e0/0x350 [btrfs] [ > 229.850788] [] ? > kmem_cache_alloc_trace+0x12a/0x180 [ 229.850788] > [] btrfs_ioctl_balance+0x1e0/0x350 [btrfs] [ > 229.850788] [] ? > update_ioctl_balance_args+0x130/0x130 [btrfs] [ 229.850788] > [] btrfs_ioctl+0xc39/0x1830 [btrfs] [ > 229.850788] [] do_vfs_ioctl+0x91/0x560 [ > 229.850788] [] ? __fget_light+0x9/0x70 [ > 229.850788] [] ? __fdget+0x9/0x20 [ 229.850788] > [] SyS_ioctl+0x53/0x80 [ 229.850788] > [] system_call_fastpath+0x16/0x1b > - -- Jeff Mahoney SUSE Labs -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQIcBAEBAgAGBQJThIGTAAoJEB57S2MheeWyxjUQAIYFZ2JM974A4fEkDxbz4yDK Hcw0A6wU5Ykv28VwReix55GkbB1u3kqTOauf0nqAVgnL5mW4c3SETbrKVhnPkg+R w5w26hUg7o9Ia+iCXNMJv+JDqXix6lHNHe7i927BDCF6BQ6+HjOAIRyi74GRZf3r glhpa4HUmqVb2pYPlepu4USUBuyV705CEywLt0IkE4QBOvVBkTQKO4T503vBMZRg morMC+Iz5p3Bndpn+oParBqt4rXKdk0U/cxdcg6j/UCopLB4D3JcChTaWTpYe311 ixsm+PI3tk6vO8KxuF6pO6wuXYOyEthARYHgJw/bPyDFHKFWXrpFiECdCEBT5jOd YcxVss+9eTO7aZ8X5gqu6/Oj9MO7ZKPjVWjVHSo8hiSy8LUaD9rbg0MwT/LMTqmC Zmz77GDpUEawQrMXhKkKe1CJdiHd+5hHizFzNZIVkdZLZklEPUCOjv9Y5GnzcYrC rkl8KMzu+6qSMl5WZSFAsgxektBrUCygZCFuRvI2bB6CoEieC46cC28q45Nw3S+P BKqX0iS2u0TIM4lj9lkYOWXyxl+0U/yEmkkwhvceUqX9BVTPD24/o6SA5XjYtsKU 6HuQx72jeLJoky5wAWjhtofhrbMjZ0ZbwDXXb8wCJ+hHk1RESqRpn+KpLWQsAuaB 6Klk0LvZvftPXWvrcuF8 =mpGl -----END PGP SIGNATURE-----