]> Git Repo - J-linux.git/commitdiff
Revert "get rid of DCACHE_GENOCIDE"
authorAl Viro <[email protected]>
Sun, 4 Feb 2024 04:53:05 +0000 (23:53 -0500)
committerAl Viro <[email protected]>
Sat, 10 Feb 2024 04:31:16 +0000 (23:31 -0500)
This reverts commit 57851607326a2beef21e67f83f4f53a90df8445a.

Unfortunately, while we only call that thing once, the callback
*can* be called more than once for the same dentry - all it
takes is rename_lock being touched while we are in d_walk().
For now let's revert it.

Signed-off-by: Al Viro <[email protected]>
fs/dcache.c
include/linux/dcache.h

index b813528fb147784c6f308e67d47f3069e3a96e33..6ebccba333368d06667eb6c1ee433046bd0ab7d8 100644 (file)
@@ -3061,7 +3061,10 @@ static enum d_walk_ret d_genocide_kill(void *data, struct dentry *dentry)
                if (d_unhashed(dentry) || !dentry->d_inode)
                        return D_WALK_SKIP;
 
-               dentry->d_lockref.count--;
+               if (!(dentry->d_flags & DCACHE_GENOCIDE)) {
+                       dentry->d_flags |= DCACHE_GENOCIDE;
+                       dentry->d_lockref.count--;
+               }
        }
        return D_WALK_CONTINUE;
 }
index 1666c387861f7a8fae32d7ae3acd17c950142ff5..d07cf2f1bb7db18c37333fd211b2e5b18657b254 100644 (file)
@@ -173,6 +173,7 @@ struct dentry_operations {
 #define DCACHE_DONTCACHE               BIT(7) /* Purge from memory on final dput() */
 
 #define DCACHE_CANT_MOUNT              BIT(8)
+#define DCACHE_GENOCIDE                        BIT(9)
 #define DCACHE_SHRINK_LIST             BIT(10)
 
 #define DCACHE_OP_WEAK_REVALIDATE      BIT(11)
This page took 0.052957 seconds and 4 git commands to generate.