Unverified Commit 6dbe134e authored by Christian Brauner's avatar Christian Brauner
Browse files

nsfs: raise DCACHE_DONTCACHE explicitly

While nsfs 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.

Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-3-2e6f823ebdc0@kernel.org


Tested-by: default avatar <syzbot@syzkaller.appspotmail.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 1e9a9be2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -591,6 +591,7 @@ static int nsfs_init_fs_context(struct fs_context *fc)
	struct pseudo_fs_context *ctx = init_pseudo(fc, NSFS_MAGIC);
	if (!ctx)
		return -ENOMEM;
	ctx->s_d_flags |= DCACHE_DONTCACHE;
	ctx->ops = &nsfs_ops;
	ctx->eops = &nsfs_export_operations;
	ctx->dops = &ns_dentry_operations;