summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Tao <bergwolf@gmail.com>2013-06-03 21:58:15 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-03 11:32:49 -0700
commitb1d2a127a98c2724129218eccd9431d342898da8 (patch)
treee13e16ac3ab3b0f8b4997a6617ae6da3536c1ab9
parent9ca6bbb505a140223c53e4b6242fb0984b6d07f1 (diff)
staging/lustre: silence lockdep warning in ll_md_blocking_ast
Got bellow lockdep warning during tests. It is false alarm though. [ 1184.479097] ============================================= [ 1184.479187] [ INFO: possible recursive locking detected ] [ 1184.479277] 3.10.0-rc3+ #13 Tainted: G C [ 1184.479355] --------------------------------------------- [ 1184.479444] mkdir/2215 is trying to acquire lock: [ 1184.479521] (&(&dentry->d_lock)->rlock){+.+...}, at: [<ffffffffa06cc27c>] ll_md_blocking_ast+0x55c/0x655 [lustre] [ 1184.479801] but task is already holding lock: [ 1184.479895] (&(&dentry->d_lock)->rlock){+.+...}, at: [<ffffffffa06cc1b1>] ll_md_blocking_ast+0x491/0x655 [lustre] [ 1184.480101] other info that might help us debug this: [ 1184.480206] Possible unsafe locking scenario: [ 1184.480300] CPU0 [ 1184.480340] ---- [ 1184.480380] lock(&(&dentry->d_lock)->rlock); [ 1184.480458] lock(&(&dentry->d_lock)->rlock); [ 1184.480536] *** DEADLOCK *** [ 1184.480761] May be due to missing lock nesting notation [ 1184.480936] 4 locks held by mkdir/2215: [ 1184.481037] #0: (sb_writers#11){.+.+.+}, at: [<ffffffff811531a9>] mnt_want_write+0x24/0x4b [ 1184.481273] #1: (&type->i_mutex_dir_key#3/1){+.+.+.}, at: [<ffffffff81144fce>] kern_path_create+0x8c/0x144 [ 1184.481513] #2: (&sb->s_type->i_lock_key#19){+.+...}, at: [<ffffffffa06cc180>] ll_md_blocking_ast+0x460/0x655 [lustre] [ 1184.481778] #3: (&(&dentry->d_lock)->rlock){+.+...}, at: [<ffffffffa06cc1b1>] ll_md_blocking_ast+0x491/0x655 [lustre] [ 1184.482050] Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/llite/dcache.c2
-rw-r--r--drivers/staging/lustre/lustre/llite/file.c2
-rw-r--r--drivers/staging/lustre/lustre/llite/llite_internal.h5
-rw-r--r--drivers/staging/lustre/lustre/llite/namei.c2
4 files changed, 6 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c
index e048538d45e6..7d6abfff9740 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -303,7 +303,7 @@ void ll_invalidate_aliases(struct inode *inode)
libcfs_debug_dumpstack(NULL);
}
- d_lustre_invalidate(dentry);
+ d_lustre_invalidate(dentry, 0);
}
ll_unlock_dcache(inode);
diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index be423171646f..ed1e3f7b4e58 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2563,7 +2563,7 @@ int __ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
here to preserve get_cwd functionality on 2.6.
Bug 10503 */
if (!dentry->d_inode->i_nlink)
- d_lustre_invalidate(dentry);
+ d_lustre_invalidate(dentry, 0);
ll_lookup_finish_locks(&oit, dentry);
} else if (!ll_have_md_lock(dentry->d_inode, &ibits, LCK_MINMODE)) {
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index e972a822b8f5..992cd203ca1a 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -1525,13 +1525,14 @@ static inline void __d_lustre_invalidate(struct dentry *dentry)
* ll_md_blocking_ast), unhash this dentry, and let dcache to reclaim it later;
* else dput() of the last refcount will unhash this dentry and kill it.
*/
-static inline void d_lustre_invalidate(struct dentry *dentry)
+static inline void d_lustre_invalidate(struct dentry *dentry, int nested)
{
CDEBUG(D_DENTRY, "invalidate dentry %.*s (%p) parent %p inode %p "
"refc %d\n", dentry->d_name.len, dentry->d_name.name, dentry,
dentry->d_parent, dentry->d_inode, d_refcount(dentry));
- spin_lock(&dentry->d_lock);
+ spin_lock_nested(&dentry->d_lock,
+ nested ? DENTRY_D_LOCK_NESTED : DENTRY_D_LOCK_NORMAL);
__d_lustre_invalidate(dentry);
if (d_refcount(dentry) == 0)
__d_drop(dentry);
diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c
index e6b3f54abbe3..58d59aa12619 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -187,7 +187,7 @@ static void ll_invalidate_negative_children(struct inode *dir)
&dentry->d_subdirs,
d_u.d_child) {
if (child->d_inode == NULL)
- d_lustre_invalidate(child);
+ d_lustre_invalidate(child, 1);
}
}
spin_unlock(&dentry->d_lock);