Skip to content

Commit b1d2a12

Browse files
bergwolfgregkh
authored andcommitted
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 <[email protected]> Signed-off-by: Andreas Dilger <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9ca6bbb commit b1d2a12

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

drivers/staging/lustre/lustre/llite/dcache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ void ll_invalidate_aliases(struct inode *inode)
303303
libcfs_debug_dumpstack(NULL);
304304
}
305305

306-
d_lustre_invalidate(dentry);
306+
d_lustre_invalidate(dentry, 0);
307307
}
308308
ll_unlock_dcache(inode);
309309

drivers/staging/lustre/lustre/llite/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2563,7 +2563,7 @@ int __ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *it,
25632563
here to preserve get_cwd functionality on 2.6.
25642564
Bug 10503 */
25652565
if (!dentry->d_inode->i_nlink)
2566-
d_lustre_invalidate(dentry);
2566+
d_lustre_invalidate(dentry, 0);
25672567

25682568
ll_lookup_finish_locks(&oit, dentry);
25692569
} else if (!ll_have_md_lock(dentry->d_inode, &ibits, LCK_MINMODE)) {

drivers/staging/lustre/lustre/llite/llite_internal.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,13 +1525,14 @@ static inline void __d_lustre_invalidate(struct dentry *dentry)
15251525
* ll_md_blocking_ast), unhash this dentry, and let dcache to reclaim it later;
15261526
* else dput() of the last refcount will unhash this dentry and kill it.
15271527
*/
1528-
static inline void d_lustre_invalidate(struct dentry *dentry)
1528+
static inline void d_lustre_invalidate(struct dentry *dentry, int nested)
15291529
{
15301530
CDEBUG(D_DENTRY, "invalidate dentry %.*s (%p) parent %p inode %p "
15311531
"refc %d\n", dentry->d_name.len, dentry->d_name.name, dentry,
15321532
dentry->d_parent, dentry->d_inode, d_refcount(dentry));
15331533

1534-
spin_lock(&dentry->d_lock);
1534+
spin_lock_nested(&dentry->d_lock,
1535+
nested ? DENTRY_D_LOCK_NESTED : DENTRY_D_LOCK_NORMAL);
15351536
__d_lustre_invalidate(dentry);
15361537
if (d_refcount(dentry) == 0)
15371538
__d_drop(dentry);

drivers/staging/lustre/lustre/llite/namei.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static void ll_invalidate_negative_children(struct inode *dir)
187187
&dentry->d_subdirs,
188188
d_u.d_child) {
189189
if (child->d_inode == NULL)
190-
d_lustre_invalidate(child);
190+
d_lustre_invalidate(child, 1);
191191
}
192192
}
193193
spin_unlock(&dentry->d_lock);

0 commit comments

Comments
 (0)