Either they are busy (in which case they won't be moved to shrink list anyway) or they have a zero refcount, in which case we really shouldn't mess with them - whoever had dropped the refcount to zero is on the way to evicting and freeing them. That way we are guaranteed that only the thread that has dropped refcount of NORCU dentry to zero might call lock_for_kill() and __dentry_kill() for those. Signed-off-by: Al Viro --- fs/dcache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/dcache.c b/fs/dcache.c index 7d8c23a42409..34d57ed9d791 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1200,7 +1200,8 @@ void d_prune_aliases(struct inode *inode) spin_lock(&inode->i_lock); for_each_alias(dentry, inode) { spin_lock(&dentry->d_lock); - __move_to_shrink_list(dentry, &dispose); + if (likely(!(dentry->d_flags & DCACHE_NORCU))) + __move_to_shrink_list(dentry, &dispose); spin_unlock(&dentry->d_lock); } spin_unlock(&inode->i_lock); -- 2.47.3