]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dealing with the rest of shrink_dentry_list() livelock
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 29 May 2014 13:11:45 +0000 (09:11 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Mar 2016 23:06:46 +0000 (15:06 -0800)
commit6179fe3753519bb624d767c02f9b685642cc63df
treee7053f21695ec61b54d4b3f75259e4d4838a35a9
parent286adf77d94e8b57a620e6cdbdcc72d99d8609b3
dealing with the rest of shrink_dentry_list() livelock

commit b2b80195d8829921506880f6dccd21cabd163d0d upstream.

We have the same problem with ->d_lock order in the inner loop, where
we are dropping references to ancestors.  Same solution, basically -
instead of using dentry_kill() we use lock_parent() (introduced in the
previous commit) to get that lock in a safe way, recheck ->d_count
(in case if lock_parent() has ended up dropping and retaking ->d_lock
and somebody managed to grab a reference during that window), trylock
the inode->i_lock and use __dentry_kill() to do the rest.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/dcache.c