]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
select_collect(): ignore dentries on shrink lists if they have positive refcounts
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 12 Apr 2026 18:17:52 +0000 (14:17 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 5 Jun 2026 04:34:55 +0000 (00:34 -0400)
If all dentries we find have positive refcounts and some happen
to be on shrink lists, there's no point trying to steal them in the
select_collect2() phase - we won't be able to evict any of them.  Busy on
shrink lists is still busy...

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

index fa12e18906b9879a848c954391990af8d2f73776..40031b806b739fa5d113d049055cf5971f79a006 100644 (file)
@@ -1589,9 +1589,7 @@ static enum d_walk_ret select_collect(void *_data, struct dentry *dentry)
        if (data->start == dentry)
                goto out;
 
-       if (dentry->d_flags & DCACHE_SHRINK_LIST) {
-               data->found++;
-       } else if (!dentry->d_lockref.count) {
+       if (!dentry->d_lockref.count) {
                to_shrink_list(dentry, &data->dispose);
                data->found++;
        } else if (dentry->d_lockref.count < 0) {