Thread (66 messages) 66 messages, 3 authors, 2025-10-23
STALE223d
Revisions (4)
  1. rfc [diff vs current]
  2. v2 current
  3. v3 [diff vs current]
  4. v4 [diff vs current]

[PATCH v2 04/63] pidfs: raise DCACHE_DONTCACHE explicitly

From: Christian Brauner <brauner@kernel.org>
Date: 2025-10-22 16:06:26
Also in: bpf, cgroups, linux-fsdevel, lkml
Subsystem: filesystems (vfs and infrastructure), the rest · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds

While pidfs dentries are never hashed and thus retain_dentry() will never
consider them for placing them on the LRU it isn't great to always have
to go and remember that. Raise DCACHE_DONTCACHE explicitly as a visual
marker that dentries aren't kept but freed immediately instead.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
 fs/pidfs.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/fs/pidfs.c b/fs/pidfs.c
index 0ef5b47d796a..db236427fc2c 100644
--- a/fs/pidfs.c
+++ b/fs/pidfs.c
@@ -1022,6 +1022,7 @@ static int pidfs_init_fs_context(struct fs_context *fc)
 
 	fc->s_iflags |= SB_I_NOEXEC;
 	fc->s_iflags |= SB_I_NODEV;
+	ctx->s_d_flags |= DCACHE_DONTCACHE;
 	ctx->ops = &pidfs_sops;
 	ctx->eops = &pidfs_export_operations;
 	ctx->dops = &pidfs_dentry_operations;
-- 
2.47.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help