pidns: call pid_ns_prepare_proc() from create_pid_namespace()
Reorganize proc_get_sb() so it can be called before the struct pid of the first process is allocated. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Serge E. Hallyn <serge@hallyn.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
45a68628d3
commit
4308eebbeb
@@ -1187,12 +1187,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
|
||||
pid = alloc_pid(p->nsproxy->pid_ns);
|
||||
if (!pid)
|
||||
goto bad_fork_cleanup_io;
|
||||
|
||||
if (clone_flags & CLONE_NEWPID) {
|
||||
retval = pid_ns_prepare_proc(p->nsproxy->pid_ns);
|
||||
if (retval < 0)
|
||||
goto bad_fork_free_pid;
|
||||
}
|
||||
}
|
||||
|
||||
p->pid = pid_nr(pid);
|
||||
|
Reference in New Issue
Block a user