]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ns: rename to exit_nsproxy_namespaces()
authorChristian Brauner <brauner@kernel.org>
Wed, 29 Oct 2025 12:20:23 +0000 (13:20 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 3 Nov 2025 16:41:17 +0000 (17:41 +0100)
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>
include/linux/nsproxy.h
kernel/cgroup/cgroup.c
kernel/exit.c
kernel/fork.c
kernel/nsproxy.c

index bd118a187dec15f55a2874a64ba1c063ea709dbe..538ba8dba1840e520fc44657081bc0e79fba43c6 100644 (file)
@@ -93,7 +93,7 @@ static inline struct cred *nsset_cred(struct nsset *set)
  */
 
 int copy_namespaces(u64 flags, struct task_struct *tsk);
-void exit_task_namespaces(struct task_struct *tsk);
+void exit_nsproxy_namespaces(struct task_struct *tsk);
 void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);
 int exec_task_namespaces(void);
 void free_nsproxy(struct nsproxy *ns);
index df8bfd26d50215e9b126b2dc09b190bcc09ad4ed..b758a9dd7526b110f3493c83012947d9187efc33 100644 (file)
@@ -1519,9 +1519,9 @@ static struct cgroup *current_cgns_cgroup_dfl(void)
        } else {
                /*
                 * NOTE: This function may be called from bpf_cgroup_from_id()
-                * on a task which has already passed exit_task_namespaces() and
-                * nsproxy == NULL. Fall back to cgrp_dfl_root which will make all
-                * cgroups visible for lookups.
+                * on a task which has already passed exit_nsproxy_namespaces()
+                * and nsproxy == NULL. Fall back to cgrp_dfl_root which will
+                * make all cgroups visible for lookups.
                 */
                return &cgrp_dfl_root.cgrp;
        }
index 9f74e8f1c431b6aa6e391ff71aadf9895a3857ae..825998103520c22b3e3259c694a82f2549470e5a 100644 (file)
@@ -962,7 +962,7 @@ void __noreturn do_exit(long code)
        exit_fs(tsk);
        if (group_dead)
                disassociate_ctty(1);
-       exit_task_namespaces(tsk);
+       exit_nsproxy_namespaces(tsk);
        exit_task_work(tsk);
        exit_thread(tsk);
 
index 3da0f08615a95eea55373a3f266fbfddd6fc9943..0926bfe4b8dfbe981ac8a5775640a727df349f90 100644 (file)
@@ -2453,7 +2453,7 @@ bad_fork_cleanup_io:
        if (p->io_context)
                exit_io_context(p);
 bad_fork_cleanup_namespaces:
-       exit_task_namespaces(p);
+       exit_nsproxy_namespaces(p);
 bad_fork_cleanup_mm:
        if (p->mm) {
                mm_clear_owner(p->mm, p);
index 19aa64ab08c830a2f5abc206b4103c13fee323c4..6ce76a0278ab4c4bc72a6c5e50b11e29eecdcb00 100644 (file)
@@ -241,7 +241,7 @@ void switch_task_namespaces(struct task_struct *p, struct nsproxy *new)
                put_nsproxy(ns);
 }
 
-void exit_task_namespaces(struct task_struct *p)
+void exit_nsproxy_namespaces(struct task_struct *p)
 {
        switch_task_namespaces(p, NULL);
 }