Skip to content

Commit 7e4a205

Browse files
author
Al Viro
committed
Revert "get rid of DCACHE_GENOCIDE"
This reverts commit 5785160. 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>
1 parent 6613476 commit 7e4a205

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

fs/dcache.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3061,7 +3061,10 @@ static enum d_walk_ret d_genocide_kill(void *data, struct dentry *dentry)
30613061
if (d_unhashed(dentry) || !dentry->d_inode)
30623062
return D_WALK_SKIP;
30633063

3064-
dentry->d_lockref.count--;
3064+
if (!(dentry->d_flags & DCACHE_GENOCIDE)) {
3065+
dentry->d_flags |= DCACHE_GENOCIDE;
3066+
dentry->d_lockref.count--;
3067+
}
30653068
}
30663069
return D_WALK_CONTINUE;
30673070
}

include/linux/dcache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ struct dentry_operations {
173173
#define DCACHE_DONTCACHE BIT(7) /* Purge from memory on final dput() */
174174

175175
#define DCACHE_CANT_MOUNT BIT(8)
176+
#define DCACHE_GENOCIDE BIT(9)
176177
#define DCACHE_SHRINK_LIST BIT(10)
177178

178179
#define DCACHE_OP_WEAK_REVALIDATE BIT(11)

0 commit comments

Comments
 (0)