Messages in this thread | | | Date | Thu, 29 May 2014 12:14:51 -0700 | Subject | Re: fs/dcache.c - BUG: soft lockup - CPU#5 stuck for 22s! [systemd-udevd:1667] | From | Linus Torvalds <> |
| |
On Thu, May 29, 2014 at 11:52 AM, Al Viro <viro@zeniv.linux.org.uk> wrote: > > Grrr... Sadly, that's not good enough. Leaking rcu_read_lock() on > success is trivial, but there's more serious problem: suppose dentries > involved get moved before we get to locking what we thought was parent. > We end up taking ->d_lock on two dentries that might be nowhere near each > other in the tree, with obvious nasty implications. Would be _very_ hard > to reproduce ;-/
Yeah, I don't think you can reproduce that, but I guess renaming directories into each other (two renames needed) could trigger an ABBA deadlock by changing the topological order of dentry/parent.
I suspect there's no way in hell that tiny race will ever happen in practice, but let's not risk it.
And your solution (to re-check after just taking the parent lock) seems sufficient and sane, since dentry_lock_for_move() will always take the parent lock(s) before we move a dentry.
So that looks good to me.
Linus
| |