linux/fs/nfs
Trond Myklebust b274b48f3e NFSv4: Fix circular locking dependency in nfs4_kill_renewd
Erez Zadok reports:

=======================================================
[ INFO: possible circular locking dependency detected ]
2.6.24-rc6-unionfs2 #80
-------------------------------------------------------
umount.nfs4/4017 is trying to acquire lock:
 (&(&clp->cl_renewd)->work){--..}, at: [<c0223e53>]
__cancel_work_timer+0x83/0x17f

but task is already holding lock:
 (&clp->cl_sem){----}, at: [<f8879897>] nfs4_kill_renewd+0x17/0x29 [nfs]

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&clp->cl_sem){----}:
       [<c0230699>] __lock_acquire+0x9cc/0xb95
       [<c0230c39>] lock_acquire+0x5f/0x78
       [<c0397cb8>] down_read+0x3a/0x4c
       [<f88798e6>] nfs4_renew_state+0x1c/0x1b8 [nfs]
       [<c0223821>] run_workqueue+0xd9/0x1ac
       [<c0224220>] worker_thread+0x7a/0x86
       [<c0226b49>] kthread+0x3b/0x62
       [<c02033a3>] kernel_thread_helper+0x7/0x10
       [<ffffffff>] 0xffffffff

-> #0 (&(&clp->cl_renewd)->work){--..}:
       [<c0230589>] __lock_acquire+0x8bc/0xb95
       [<c0230c39>] lock_acquire+0x5f/0x78
       [<c0223e87>] __cancel_work_timer+0xb7/0x17f
       [<c0223f5a>] cancel_delayed_work_sync+0xb/0xd
       [<f887989e>] nfs4_kill_renewd+0x1e/0x29 [nfs]
       [<f885a8f6>] nfs_free_client+0x37/0x9e [nfs]
       [<f885ab20>] nfs_put_client+0x5d/0x62 [nfs]
       [<f885ab9a>] nfs_free_server+0x75/0xae [nfs]
       [<f8862672>] nfs4_kill_super+0x27/0x2b [nfs]
       [<c0258aab>] deactivate_super+0x3f/0x51
       [<c0269668>] mntput_no_expire+0x42/0x67
       [<c025d0e4>] path_release_on_umount+0x15/0x18
       [<c0269d30>] sys_umount+0x1a3/0x1cb
       [<c0269d71>] sys_oldumount+0x19/0x1b
       [<c02026ca>] sysenter_past_esp+0x5f/0xa5
       [<ffffffff>] 0xffffffff

Looking at the code, it would seem that taking the clp->cl_sem in
nfs4_kill_renewd is completely redundant, since we're already guaranteed to
have exclusive access to the nfs_client (we're shutting down).

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2008-01-03 09:37:16 -05:00
..
callback_proc.c [PATCH] fs/nfs/callback* passes error values big-endian 2006-10-20 10:26:40 -07:00
callback_xdr.c NFSv4: debug print ntohl(status) in nfs client callback xdr code 2007-07-19 15:21:40 -04:00
callback.c Freezer: make kernel threads nonfreezable by default 2007-07-17 10:23:02 -07:00
callback.h NFS: Fix more sparse warnings 2007-05-14 19:33:46 -04:00
client.c NFSv2/v3: Fix a memory leak when using -onolock 2007-12-11 22:01:56 -05:00
delegation.c NFSv4: Fix an rpc_cred reference leakage in fs/nfs/delegation.c 2007-10-19 17:19:30 -04:00
delegation.h NFSv4: Use RCU to protect delegations 2007-07-10 23:40:41 -04:00
dir.c NFS: fs/nfs/dir.c should #include "internal.h" 2007-11-26 16:24:49 -05:00
direct.c Revert "NFS: Ensure we return zero if applications attempt to write zero bytes" 2007-12-12 11:08:33 -05:00
file.c NFSv4: Ensure that we wait for the CLOSE request to complete 2007-10-19 17:19:25 -04:00
getroot.c NFS: Fix an Oops in NFS unmount 2007-12-12 11:12:15 -05:00
idmap.c NFS: use __set_current_state() 2007-05-09 17:58:01 -04:00
inode.c NFSv4: Ensure that we wait for the CLOSE request to complete 2007-10-19 17:19:25 -04:00
internal.h NFS: use in-kernel mount argument structure for nfsv4 mounts 2007-10-09 17:17:28 -04:00
iostat.h NFSv4: Fix an oops in nfs4_fill_super 2006-03-20 13:44:48 -05:00
Makefile [NFS] [PATCH] nfs: tiny makefile cleanup 2007-10-09 17:15:36 -04:00
mount_clnt.c NFS: Improve debugging output in NFS in-kernel mount client 2007-07-10 23:40:47 -04:00
namespace.c NFS: Fix use of cancel_delayed_work_sync in nfs_release_automount_timer 2007-09-01 10:14:36 -04:00
nfs2xdr.c SUNRPC: mark bulk read/write data in xdrbuf 2007-10-09 17:17:34 -04:00
nfs3acl.c NFS: Remove nfs_begin_data_update/nfs_end_data_update 2007-10-09 17:19:53 -04:00
nfs3proc.c NFS: Use nfs_refresh_inode() in ops that aren't expected to change the inode 2007-10-09 17:20:45 -04:00
nfs3xdr.c SUNRPC: mark bulk read/write data in xdrbuf 2007-10-09 17:17:34 -04:00
nfs4_fs.h nfs: Fix build break with CONFIG_NFS_V4=n 2007-10-19 19:27:46 -07:00
nfs4namespace.c NFSv4: /proc/mounts displays the wrong server name for referrals 2007-02-03 15:35:10 -08:00
nfs4proc.c NFSv4: Ensure that we wait for the CLOSE request to complete 2007-10-19 17:19:25 -04:00
nfs4renewd.c NFSv4: Fix circular locking dependency in nfs4_kill_renewd 2008-01-03 09:37:16 -05:00
nfs4state.c NFSv4: Ensure that we wait for the CLOSE request to complete 2007-10-19 17:19:25 -04:00
nfs4xdr.c NFSv4: Make NFSv4 ACCESS calls return attributes too... 2007-10-09 17:18:38 -04:00
nfsroot.c Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
pagelist.c mm: Remove slab destructors from kmem_cache_create(). 2007-07-20 10:11:58 +09:00
proc.c NFSv2: Ensure that the directory metadata gets revalidated on file create 2007-10-21 13:37:02 -04:00
read.c NFS: Fix atime revalidation in read() 2007-10-09 17:19:06 -04:00
super.c NFS: Fix a possible Oops in fs/nfs/super.c 2008-01-03 09:37:11 -05:00
symlink.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
sysctl.c [PATCH] nfs: fix congestion control 2007-03-16 19:25:05 -07:00
unlink.c NFS: Fix a typo in nfs_call_unlink() 2007-10-21 13:37:07 -04:00
write.c NFS: make nfs_wb_page_priority() static 2007-11-26 16:24:48 -05:00