All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: dsterba@suse.cz, linux-btrfs <linux-btrfs@vger.kernel.org>,
	Chris Mason <clm@fb.com>
Subject: Re: [PATCH v3] btrfs: allocate raid type kobjects dynamically
Date: Tue, 27 May 2014 08:14:11 -0400	[thread overview]
Message-ID: <53848193.9090709@suse.com> (raw)
In-Reply-To: <20140527112604.GJ5346@suse.cz>

-----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: [<ffffffff811ee787>]
> kernfs_remove+0x27/0x40 [  229.850788] [  229.850788] but task is
> already holding lock: [  229.850788]  (&found->groups_sem){++++..},
> at: [<ffffffffa0023abe>] 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]
> [<ffffffff810b0662>] lock_acquire+0x92/0x120 [  229.850788]
> [<ffffffff81a0bedc>] down_read+0x4c/0xa0 [  229.850788]
> [<ffffffffa004babe>] raid_bytes_show+0x3e/0xd0 [btrfs] [
> 229.850788]        [<ffffffff813b9ef6>] kobj_attr_show+0x16/0x20 [
> 229.850788]        [<ffffffff811f04e9>]
> sysfs_kf_seq_show+0xd9/0x230 [  229.850788]
> [<ffffffff811eec56>] kernfs_seq_show+0x26/0x30 [  229.850788]
> [<ffffffff8119ec8f>] seq_read+0xef/0x410 [  229.850788]
> [<ffffffff811efa35>] kernfs_fop_read+0x125/0x180 [  229.850788]
> [<ffffffff81179fe4>] vfs_read+0xb4/0x180 [  229.850788]
> [<ffffffff8117a269>] SyS_read+0x59/0xd0 [  229.850788]
> [<ffffffff81a16cd2>] system_call_fastpath+0x16/0x1b [  229.850788] 
> -> #0 (s_active#149){++++.+}: [  229.850788]
> [<ffffffff810afc5c>] __lock_acquire+0x1c4c/0x1fa0 [  229.850788]
> [<ffffffff810b0662>] lock_acquire+0x92/0x120 [  229.850788]
> [<ffffffff811edc07>] __kernfs_remove+0x2b7/0x380 [  229.850788]
> [<ffffffff811ee787>] kernfs_remove+0x27/0x40 [  229.850788]
> [<ffffffff811f0b3a>] sysfs_remove_dir+0x5a/0x90 [  229.850788]
> [<ffffffff813ba028>] kobject_del+0x18/0x90 [  229.850788]
> [<ffffffffa0023cb2>] btrfs_remove_block_group+0x442/0x580 [btrfs] [
> 229.850788]        [<ffffffffa005caf4>]
> btrfs_relocate_chunk+0x624/0x770 [btrfs] [  229.850788]
> [<ffffffffa005f652>] btrfs_balance+0x902/0xf50 [btrfs] [
> 229.850788]        [<ffffffffa006b090>]
> btrfs_ioctl_balance+0x1e0/0x350 [btrfs] [  229.850788]
> [<ffffffffa006d4a9>] btrfs_ioctl+0xc39/0x1830 [btrfs] [
> 229.850788]        [<ffffffff8118c381>] do_vfs_ioctl+0x91/0x560 [
> 229.850788]        [<ffffffff8118c8a3>] SyS_ioctl+0x53/0x80 [
> 229.850788]        [<ffffffff81a16cd2>]
> 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: [<ffffffff8119a828>]
> mnt_want_write_file+0x28/0x60 [  229.850788]  #1:
> (&fs_info->volume_mutex){+.+.+.}, at: [<ffffffffa006afe1>]
> btrfs_ioctl_balance+0x131/0x350 [btrfs] [  229.850788]  #2:
> (sb_internal){.+.+..}, at: [<ffffffffa0035436>]
> start_transaction+0x456/0x550 [btrfs] [  229.850788]  #3:
> (&fs_info->chunk_mutex){+.+...}, at: [<ffffffffa005927e>]
> lock_chunks+0x1e/0x20 [btrfs] [  229.850788]  #4:
> (&found->groups_sem){++++..}, at: [<ffffffffa0023abe>]
> 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]  [<ffffffff81a07898>]
> dump_stack+0x51/0x71 [  229.850788]  [<ffffffff810acb74>]
> print_circular_bug+0x214/0x310 [  229.850788]  [<ffffffff810afc5c>]
> __lock_acquire+0x1c4c/0x1fa0 [  229.850788]  [<ffffffff811ee787>] ?
> kernfs_remove+0x27/0x40 [  229.850788]  [<ffffffff810b0662>]
> lock_acquire+0x92/0x120 [  229.850788]  [<ffffffff811ee787>] ?
> kernfs_remove+0x27/0x40 [  229.850788]  [<ffffffff81a0bb39>] ?
> mutex_unlock+0x9/0x10 [  229.850788]  [<ffffffff811edc07>]
> __kernfs_remove+0x2b7/0x380 [  229.850788]  [<ffffffff811ee787>] ?
> kernfs_remove+0x27/0x40 [  229.850788]  [<ffffffff811ee77f>] ?
> kernfs_remove+0x1f/0x40 [  229.850788]  [<ffffffff811ee787>]
> kernfs_remove+0x27/0x40 [  229.850788]  [<ffffffff811f0b3a>]
> sysfs_remove_dir+0x5a/0x90 [  229.850788]  [<ffffffff813ba028>]
> kobject_del+0x18/0x90 [  229.850788]  [<ffffffffa0023cb2>]
> btrfs_remove_block_group+0x442/0x580 [btrfs] [  229.850788]
> [<ffffffff810b112d>] ? trace_hardirqs_on_caller+0x11d/0x1e0 [
> 229.850788]  [<ffffffffa005caf4>] btrfs_relocate_chunk+0x624/0x770
> [btrfs] [  229.850788]  [<ffffffffa0056ac6>] ?
> release_extent_buffer+0x36/0xe0 [btrfs] [  229.850788]
> [<ffffffffa005706a>] ? free_extent_buffer+0x4a/0xc0 [btrfs] [
> 229.850788]  [<ffffffffa0057080>] ? free_extent_buffer+0x60/0xc0
> [btrfs] [  229.850788]  [<ffffffffa005f652>]
> btrfs_balance+0x902/0xf50 [btrfs] [  229.850788]
> [<ffffffffa006b090>] ? btrfs_ioctl_balance+0x1e0/0x350 [btrfs] [
> 229.850788]  [<ffffffff8116e3fa>] ?
> kmem_cache_alloc_trace+0x12a/0x180 [  229.850788]
> [<ffffffffa006b090>] btrfs_ioctl_balance+0x1e0/0x350 [btrfs] [
> 229.850788]  [<ffffffffa006c870>] ?
> update_ioctl_balance_args+0x130/0x130 [btrfs] [  229.850788]
> [<ffffffffa006d4a9>] btrfs_ioctl+0xc39/0x1830 [btrfs] [
> 229.850788]  [<ffffffff8118c381>] do_vfs_ioctl+0x91/0x560 [
> 229.850788]  [<ffffffff81197959>] ? __fget_light+0x9/0x70 [
> 229.850788]  [<ffffffff811979c9>] ? __fdget+0x9/0x20 [  229.850788]
> [<ffffffff8118c8a3>] SyS_ioctl+0x53/0x80 [  229.850788]
> [<ffffffff81a16cd2>] 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-----

  reply	other threads:[~2014-05-27 12:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-27  1:35 [PATCH v3] btrfs: allocate raid type kobjects dynamically Jeff Mahoney
2014-05-27 11:26 ` David Sterba
2014-05-27 12:14   ` Jeff Mahoney [this message]
2014-05-27 15:23     ` David Sterba
2014-05-27 16:10 ` Chris Mason
2014-05-27 16:58   ` Jeff Mahoney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53848193.9090709@suse.com \
    --to=jeffm@suse.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.