From: Peter Zijlstra Date: Fri, 8 Dec 2006 10:39:38 +0000 (-0800) Subject: [PATCH] lockdep: annotate nfsd4 recover code X-Git-Tag: v2.6.20-rc1~34^2~140 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4b75f78edcab291eb29fe9a205cbf7b80c1c644f;p=linux-2.6-omap-h63xx.git [PATCH] lockdep: annotate nfsd4 recover code > ============================================= > [ INFO: possible recursive locking detected ] > 2.6.18-1.2724.lockdepPAE #1 > --------------------------------------------- > nfsd/6884 is trying to acquire lock: > (&inode->i_mutex){--..}, at: [] vfs_rmdir+0x73/0xf4 > > but task is already holding lock: > (&inode->i_mutex){--..}, at: [] > nfsd4_clear_clid_dir+0x1f/0x3d [nfsd] > > other info that might help us debug this: > 3 locks held by nfsd/6884: > #0: (hash_sem){----}, at: [] nfsd+0x181/0x2ea [nfsd] > #1: (client_mutex){--..}, at: [] > nfsd4_setclientid_confirm+0x3b/0x2cf [nfsd] > #2: (&inode->i_mutex){--..}, at: [] > nfsd4_clear_clid_dir+0x1f/0x3d [nfsd] > > stack backtrace: > [] dump_trace+0x69/0x1af > [] show_trace_log_lvl+0x18/0x2c > [] show_trace+0xf/0x11 > [] dump_stack+0x15/0x17 > [] __lock_acquire+0x110/0x9b6 > [] lock_acquire+0x5c/0x7a > [] __mutex_lock_slowpath+0xde/0x234 > [] vfs_rmdir+0x73/0xf4 > [] nfsd4_clear_clid_dir+0x29/0x3d [nfsd] > [] nfsd4_remove_clid_dir+0xb8/0xf8 [nfsd] > [] nfsd4_setclientid_confirm+0x1b2/0x2cf [nfsd] > [] nfsd4_proc_compound+0x137a/0x166c [nfsd] > [] nfsd_dispatch+0xc5/0x180 [nfsd] > [] svc_process+0x3bd/0x631 [sunrpc] > [] nfsd+0x19a/0x2ea [nfsd] > [] kernel_thread_helper+0x7/0x10 > DWARF2 unwinder stuck at kernel_thread_helper+0x7/0x10 > Leftover inexact backtrace: > ======================= Some nesting annotation to the nfsd4 recovery code. The vfs operations called will take dentry->d_inode->i_mutex. Signed-off-by: Peter Zijlstra Cc: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 81b8565d383..c7774e3a946 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -259,7 +259,7 @@ nfsd4_remove_clid_file(struct dentry *dir, struct dentry *dentry) printk("nfsd4: non-file found in client recovery directory\n"); return -EINVAL; } - mutex_lock(&dir->d_inode->i_mutex); + mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); status = vfs_unlink(dir->d_inode, dentry); mutex_unlock(&dir->d_inode->i_mutex); return status;