Revert "get rid of DCACHE_GENOCIDE"

This reverts commit 5785160732.

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 <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2024-02-03 23:53:05 -05:00
parent 6613476e22
commit 7e4a205fe5
2 changed files with 5 additions and 1 deletions

View File

@ -3061,8 +3061,11 @@ static enum d_walk_ret d_genocide_kill(void *data, struct dentry *dentry)
if (d_unhashed(dentry) || !dentry->d_inode) if (d_unhashed(dentry) || !dentry->d_inode)
return D_WALK_SKIP; return D_WALK_SKIP;
if (!(dentry->d_flags & DCACHE_GENOCIDE)) {
dentry->d_flags |= DCACHE_GENOCIDE;
dentry->d_lockref.count--; dentry->d_lockref.count--;
} }
}
return D_WALK_CONTINUE; return D_WALK_CONTINUE;
} }

View File

@ -173,6 +173,7 @@ struct dentry_operations {
#define DCACHE_DONTCACHE BIT(7) /* Purge from memory on final dput() */ #define DCACHE_DONTCACHE BIT(7) /* Purge from memory on final dput() */
#define DCACHE_CANT_MOUNT BIT(8) #define DCACHE_CANT_MOUNT BIT(8)
#define DCACHE_GENOCIDE BIT(9)
#define DCACHE_SHRINK_LIST BIT(10) #define DCACHE_SHRINK_LIST BIT(10)
#define DCACHE_OP_WEAK_REVALIDATE BIT(11) #define DCACHE_OP_WEAK_REVALIDATE BIT(11)