Re: [git pull] Re: fs/dcache.c - BUG: soft lockup - CPU#5 stuck for 22s! [systemd-udevd:1667]

From: Linus Torvalds
Date: Sat May 31 2014 - 10:48:26 EST




On Sat, 31 May 2014, Josh Boyer wrote:
>
> One of my machines got the lockdep report below when booting a kernel
> that contained these patches.

I think this is just a lacking annotation.

We do nest dentry d_lock locking, and in order to avoid ABBA deadlocks the
rule is that we lock things in topological order (parent dentry first).
lock_parent() is very careful about that, but doesn't actually tell
lockdep about it.

This trivial oneliner should fix it.

Linus

---
fs/dcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index bce851dc03ef..be2bea834bf4 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -553,7 +553,7 @@ again:
}
rcu_read_unlock();
if (parent != dentry)
- spin_lock(&dentry->d_lock);
+ spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
else
parent = NULL;
return parent;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/