Subject: [PATCH] Rename CLONE_NEWPSPACE CLONE_NPSPACE and cleanup the sanity tests. From: Eric W. Biederman Date: 1132724685 -0700 --- include/linux/sched.h | 2 +- kernel/fork.c | 10 ++++------ kernel/pid.c | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) 445a29c4b0b6fd2a1b5577509816364b0cad8fa5 diff --git a/include/linux/sched.h b/include/linux/sched.h index 2dd4d83..4947116 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -60,7 +60,7 @@ struct exec_domain; #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ -#define CLONE_NEWPSPACE 0x04000000 /* New process space */ +#define CLONE_NPSPACE 0x04000000 /* New process space */ /* * List of flags we want to share for kernel threads, diff --git a/kernel/fork.c b/kernel/fork.c index 93957a3..c8e0118 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -872,12 +872,10 @@ static task_t *copy_process(unsigned lon if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS)) return ERR_PTR(-EINVAL); - /* For the moment don't allow sharing in the context of CLONE_NEWPSPACE - * Some sharing is likely safe but I haven't looked closely to see what that - * is yet. CLONE_THREAD is clearly not. + /* If I'm not sharing process ids I can't share signals or pids. */ - if ((clone_flags & CLONE_NEWPSPACE) && - (clone_flags & (CLONE_THREAD|CLONE_FS|CLONE_SIGHAND|CLONE_VM))) + if ((clone_flags & CLONE_NPSPACE) && + (clone_flags & (CLONE_THREAD|CLONE_SIGHAND))) return ERR_PTR(-EINVAL); /* @@ -1144,7 +1142,7 @@ static task_t *copy_process(unsigned lon cpuset_fork(p); - if (clone_flags & CLONE_NEWPSPACE) { + if (clone_flags & CLONE_NPSPACE) { /* Allocate new session and process groups */ p->signal->leader = 0; p->signal->pgrp = 0; diff --git a/kernel/pid.c b/kernel/pid.c index 6144189..7054adb 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -305,7 +305,7 @@ int copy_pspace(int flags, struct task_s int pid; get_pspace(p->pspace); - if (!(flags & CLONE_NEWPSPACE)) + if (!(flags & CLONE_NPSPACE)) return 0; /* Allocate the new pidspace structure */ -- 1.0.GIT