Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ns: rename to exit_nsproxy_namespaces()

The current naming is very misleading as this really isn't exiting all
of the task's namespaces. It is only exiting the namespaces that hang of
off nsproxy. Reflect that in the name.

Link: https://patch.msgid.link/20251029-work-namespace-nstree-listns-v4-10-2e6f823ebdc0@kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>

+7 -7
+1 -1
include/linux/nsproxy.h
··· 93 93 */ 94 94 95 95 int copy_namespaces(u64 flags, struct task_struct *tsk); 96 - void exit_task_namespaces(struct task_struct *tsk); 96 + void exit_nsproxy_namespaces(struct task_struct *tsk); 97 97 void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new); 98 98 int exec_task_namespaces(void); 99 99 void free_nsproxy(struct nsproxy *ns);
+3 -3
kernel/cgroup/cgroup.c
··· 1519 1519 } else { 1520 1520 /* 1521 1521 * NOTE: This function may be called from bpf_cgroup_from_id() 1522 - * on a task which has already passed exit_task_namespaces() and 1523 - * nsproxy == NULL. Fall back to cgrp_dfl_root which will make all 1524 - * cgroups visible for lookups. 1522 + * on a task which has already passed exit_nsproxy_namespaces() 1523 + * and nsproxy == NULL. Fall back to cgrp_dfl_root which will 1524 + * make all cgroups visible for lookups. 1525 1525 */ 1526 1526 return &cgrp_dfl_root.cgrp; 1527 1527 }
+1 -1
kernel/exit.c
··· 962 962 exit_fs(tsk); 963 963 if (group_dead) 964 964 disassociate_ctty(1); 965 - exit_task_namespaces(tsk); 965 + exit_nsproxy_namespaces(tsk); 966 966 exit_task_work(tsk); 967 967 exit_thread(tsk); 968 968
+1 -1
kernel/fork.c
··· 2453 2453 if (p->io_context) 2454 2454 exit_io_context(p); 2455 2455 bad_fork_cleanup_namespaces: 2456 - exit_task_namespaces(p); 2456 + exit_nsproxy_namespaces(p); 2457 2457 bad_fork_cleanup_mm: 2458 2458 if (p->mm) { 2459 2459 mm_clear_owner(p->mm, p);
+1 -1
kernel/nsproxy.c
··· 241 241 put_nsproxy(ns); 242 242 } 243 243 244 - void exit_task_namespaces(struct task_struct *p) 244 + void exit_nsproxy_namespaces(struct task_struct *p) 245 245 { 246 246 switch_task_namespaces(p, NULL); 247 247 }