diff options
Diffstat (limited to 'kernel/pid_namespace.c')
-rw-r--r-- | kernel/pid_namespace.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index 84591cfeefc1..3cc29b830e9e 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c | |||
@@ -217,22 +217,15 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) | |||
217 | 217 | ||
218 | /* | 218 | /* |
219 | * sys_wait4() above can't reap the TASK_DEAD children. | 219 | * sys_wait4() above can't reap the TASK_DEAD children. |
220 | * Make sure they all go away, see __unhash_process(). | 220 | * Make sure they all go away, see free_pid(). |
221 | */ | 221 | */ |
222 | for (;;) { | 222 | for (;;) { |
223 | bool need_wait = false; | 223 | set_current_state(TASK_UNINTERRUPTIBLE); |
224 | 224 | if (pid_ns->nr_hashed == 1) | |
225 | read_lock(&tasklist_lock); | ||
226 | if (!list_empty(¤t->children)) { | ||
227 | __set_current_state(TASK_UNINTERRUPTIBLE); | ||
228 | need_wait = true; | ||
229 | } | ||
230 | read_unlock(&tasklist_lock); | ||
231 | |||
232 | if (!need_wait) | ||
233 | break; | 225 | break; |
234 | schedule(); | 226 | schedule(); |
235 | } | 227 | } |
228 | __set_current_state(TASK_RUNNING); | ||
236 | 229 | ||
237 | if (pid_ns->reboot) | 230 | if (pid_ns->reboot) |
238 | current->signal->group_exit_code = pid_ns->reboot; | 231 | current->signal->group_exit_code = pid_ns->reboot; |