{"action":"opened","issue":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/3916","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/3916/labels{/name}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/3916/comments","events_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/3916/events","html_url":"https://github.com/zfsonlinux/zfs/issues/3916","id":111075669,"number":3916,"title":"lockdep warning: possible recursive locking (&zp->z_name_lock) at zfs_rmdir","user":{"login":"ofaaland","id":8368499,"avatar_url":"https://avatars.githubusercontent.com/u/8368499?v=3","gravatar_id":"","url":"https://api.github.com/users/ofaaland","html_url":"https://github.com/ofaaland","followers_url":"https://api.github.com/users/ofaaland/followers","following_url":"https://api.github.com/users/ofaaland/following{/other_user}","gists_url":"https://api.github.com/users/ofaaland/gists{/gist_id}","starred_url":"https://api.github.com/users/ofaaland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofaaland/subscriptions","organizations_url":"https://api.github.com/users/ofaaland/orgs","repos_url":"https://api.github.com/users/ofaaland/repos","events_url":"https://api.github.com/users/ofaaland/events{/privacy}","received_events_url":"https://api.github.com/users/ofaaland/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-12T23:45:18Z","updated_at":"2015-10-12T23:45:18Z","closed_at":null,"body":"lockdep reports:\r\n```\r\n[ INFO: possible recursive locking detected ]                                      \r\n2.6.32-504.16.2.1chaos.ch5.3.x86_64.debug #1                                       \r\n---------------------------------------------                                      \r\nrm/10170 is trying to acquire lock:                                                \r\n (&zp->z_name_lock){++++..}, at: [<ffffffffa03f4548>] zfs_rmdir+0x1c8/0x530 [zfs]  \r\n\r\nbut task is already holding lock:\r\n (&zp->z_name_lock){++++..}, at: [<ffffffffa03dadf2>] zfs_dirent_lock+0x472/0x850 [zfs]\r\n\r\nother info that might help us debug this:\r\n3 locks held by rm/10170:                \r\n #0:  (&sb->s_type->i_mutex_key#14/1){+.+...}, at: [<ffffffff811bda8c>] do_rmdir+0x15c/0x1f0\r\n #1:  (&sb->s_type->i_mutex_key#14){+.+.+.}, at: [<ffffffff811bac26>] vfs_rmdir+0x66/0x100  \r\n #2:  (&zp->z_name_lock){++++..}, at: [<ffffffffa03dadf2>] zfs_dirent_lock+0x472/0x850 [zfs]\r\n\r\nstack backtrace:\r\nPid: 10170, comm: rm Not tainted 2.6.32-504.16.2.1chaos.ch5.3.x86_64.debug #1\r\nCall Trace:\r\n [<ffffffff810bfe90>] ? __lock_acquire+0x11b0/0x1560\r\n [<ffffffffa03d2606>] ? zfs_zaccess_aces_check+0x1c6/0x560 [zfs]\r\n [<ffffffff810c02e4>] ? lock_acquire+0xa4/0x120\r\n [<ffffffffa03f4548>] ? zfs_rmdir+0x1c8/0x530 [zfs]\r\n [<ffffffffa03d363e>] ? zfs_zaccess_common+0xae/0x260 [zfs]\r\n [<ffffffff815603b1>] ? down_write+0x61/0xb0\r\n [<ffffffffa03f4548>] ? zfs_rmdir+0x1c8/0x530 [zfs]\r\n [<ffffffffa03f4548>] ? zfs_rmdir+0x1c8/0x530 [zfs]\r\n [<ffffffff810acb48>] ? sched_clock_cpu+0xb8/0x110\r\n [<ffffffffa0413ef5>] ? zpl_rmdir+0x65/0xa0 [zfs]\r\n [<ffffffff811bac82>] ? vfs_rmdir+0xc2/0x100\r\n [<ffffffff811b9d7a>] ? lookup_hash+0x3a/0x50\r\n [<ffffffff811bdab9>] ? do_rmdir+0x189/0x1f0\r\n [<ffffffff811ad3e6>] ? __fput+0x1d6/0x280\r\n [<ffffffff8100b0aa>] ? sysret_check+0x2e/0x69\r\n [<ffffffff810be4dd>] ? trace_hardirqs_on_caller+0x14d/0x190\r\n [<ffffffff810f79b7>] ? audit_syscall_entry+0x1d7/0x200\r\n [<ffffffff815614a2>] ? trace_hardirqs_on_thunk+0x3a/0x3f\r\n [<ffffffff811bdb4d>] ? sys_unlinkat+0x2d/0x40\r\n [<ffffffff8100b072>] ? system_call_fastpath+0x16/0x1b\r\n\r\n /* NOTE\r\n  * gdb reports following for the two locations the lock is acquired\r\n  */\r\nReading symbols from /home/.../zfs/module/zfs/zfs.ko...done.\r\n(gdb) l *(zfs_rmdir+0x1c4)\r\n0xca574 is in zfs_rmdir (/home/.../zfs/module/zfs/zfs_vnops.c:1928).\r\n1923\r\n1924            /*\r\n1925             * Grab a lock on the directory to make sure that noone is\r\n1926             * trying to add (or lookup) entries while we are removing it.\r\n1927             */\r\n1928            rw_enter(&zp->z_name_lock, RW_WRITER);\r\n1929\r\n1930            /*\r\n1931             * Grab a lock on the parent pointer to make sure we play well\r\n1932             * with the treewalk and directory rename code.\r\n\r\n(gdb) l *(zfs_dirent_lock+0x472)\r\n0xb0e22 is in zfs_dirent_lock (/home/.../zfs/module/zfs/zfs_dir.c:241).\r\n236              */\r\n237             ASSERT(!(flag & ZSHARED) || !(flag & ZHAVELOCK));\r\n238             if (!(flag & ZHAVELOCK))\r\n239                     rw_enter(&dzp->z_name_lock, RW_READER);\r\n240\r\n241             mutex_enter(&dzp->z_lock);\r\n242             for (;;) {\r\n243                     if (dzp->z_unlinked) {\r\n244                             mutex_exit(&dzp->z_lock);\r\n245                             if (!(flag & ZHAVELOCK))\r\n"}}