d_prune_aliases(): make sure to skip NORCU aliases

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 <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2026-05-04 02:49:20 -04:00
parent 67132b5e5d
commit b9c505cbf4

View File

@ -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);