diff options
Diffstat (limited to 'kernel/pid_namespace.c')
-rw-r--r-- | kernel/pid_namespace.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index c1c3dc1c6023..6917e8edb48e 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c | |||
@@ -15,12 +15,10 @@ | |||
15 | #include <linux/err.h> | 15 | #include <linux/err.h> |
16 | #include <linux/acct.h> | 16 | #include <linux/acct.h> |
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <linux/proc_fs.h> | 18 | #include <linux/proc_ns.h> |
19 | #include <linux/reboot.h> | 19 | #include <linux/reboot.h> |
20 | #include <linux/export.h> | 20 | #include <linux/export.h> |
21 | 21 | ||
22 | #define BITS_PER_PAGE (PAGE_SIZE*8) | ||
23 | |||
24 | struct pid_cache { | 22 | struct pid_cache { |
25 | int nr_ids; | 23 | int nr_ids; |
26 | char name[16]; | 24 | char name[16]; |
@@ -181,6 +179,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) | |||
181 | int nr; | 179 | int nr; |
182 | int rc; | 180 | int rc; |
183 | struct task_struct *task, *me = current; | 181 | struct task_struct *task, *me = current; |
182 | int init_pids = thread_group_leader(me) ? 1 : 2; | ||
184 | 183 | ||
185 | /* Don't allow any more processes into the pid namespace */ | 184 | /* Don't allow any more processes into the pid namespace */ |
186 | disable_pid_allocation(pid_ns); | 185 | disable_pid_allocation(pid_ns); |
@@ -230,7 +229,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) | |||
230 | */ | 229 | */ |
231 | for (;;) { | 230 | for (;;) { |
232 | set_current_state(TASK_UNINTERRUPTIBLE); | 231 | set_current_state(TASK_UNINTERRUPTIBLE); |
233 | if (pid_ns->nr_hashed == 1) | 232 | if (pid_ns->nr_hashed == init_pids) |
234 | break; | 233 | break; |
235 | schedule(); | 234 | schedule(); |
236 | } | 235 | } |