Merge branch 'tracing/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/frederi...
[safe/jmp/linux-2.6] / kernel / exit.c
index 7ef355d..869dc22 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/completion.h>
 #include <linux/personality.h>
 #include <linux/tty.h>
-#include <linux/mnt_namespace.h>
 #include <linux/iocontext.h>
 #include <linux/key.h>
 #include <linux/security.h>
@@ -1082,8 +1081,8 @@ SYSCALL_DEFINE1(exit_group, int, error_code)
 
 struct wait_opts {
        enum pid_type           wo_type;
-       struct pid              *wo_pid;
        int                     wo_flags;
+       struct pid              *wo_pid;
 
        struct siginfo __user   *wo_info;
        int __user              *wo_stat;
@@ -1197,8 +1196,11 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
        }
 
        traced = ptrace_reparented(p);
-
-       if (likely(!traced)) {
+       /*
+        * It can be ptraced but not reparented, check
+        * !task_detached() to filter out sub-threads.
+        */
+       if (likely(!traced) && likely(!task_detached(p))) {
                struct signal_struct *psig;
                struct signal_struct *sig;