summaryrefslogtreecommitdiffstats
path: root/kernel/pid_namespace.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-07-18 13:53:06 +0200
committerTakashi Iwai <tiwai@suse.de>2012-07-18 13:53:06 +0200
commit61eab000f3536f080eab43fd5eed3fd817ded76e (patch)
treed1448b3b90c5650b522c8d13d8bdd7bd65a5cf52 /kernel/pid_namespace.c
parent68e67f40b7343383517c3f951b4b8db7626406bc (diff)
parent4e01ec636e64707d202a1ca21a47bbc6d53085b7 (diff)
downloadlinux-61eab000f3536f080eab43fd5eed3fd817ded76e.tar.bz2
Merge branch 'topic/hda' into for-next
This is a large chunk merge for 3.6 HD-audio things
Diffstat (limited to 'kernel/pid_namespace.c')
-rw-r--r--kernel/pid_namespace.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 16b20e38c4a1..b3c7fd554250 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -184,11 +184,31 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)
}
read_unlock(&tasklist_lock);
+ /* Firstly reap the EXIT_ZOMBIE children we may have. */
do {
clear_thread_flag(TIF_SIGPENDING);
rc = sys_wait4(-1, NULL, __WALL, NULL);
} while (rc != -ECHILD);
+ /*
+ * sys_wait4() above can't reap the TASK_DEAD children.
+ * Make sure they all go away, see __unhash_process().
+ */
+ for (;;) {
+ bool need_wait = false;
+
+ read_lock(&tasklist_lock);
+ if (!list_empty(&current->children)) {
+ __set_current_state(TASK_UNINTERRUPTIBLE);
+ need_wait = true;
+ }
+ read_unlock(&tasklist_lock);
+
+ if (!need_wait)
+ break;
+ schedule();
+ }
+
if (pid_ns->reboot)
current->signal->group_exit_code = pid_ns->reboot;