Unverified Commit 4b06b70c authored by Christian Brauner's avatar Christian Brauner
Browse files

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: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 6b053576
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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;
	}
+1 −1
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -2453,7 +2453,7 @@ __latent_entropy struct task_struct *copy_process(
	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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
}