ptrace: wait_consider_task: s/same_thread_group/ptrace_reparented/
authorOleg Nesterov <oleg@redhat.com>
Fri, 24 Jun 2011 15:34:39 +0000 (17:34 +0200)
committerOleg Nesterov <oleg@redhat.com>
Mon, 27 Jun 2011 18:30:11 +0000 (20:30 +0200)
wait_consider_task() checks same_thread_group(parent, real_parent),
this is the open-coded ptrace_reparented().

__ptrace_detach() remains the only function which has to check this by
hand, although we could reorganize the code to delay __ptrace_unlink.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Tejun Heo <tj@kernel.org>
kernel/exit.c

index 9fa99702645da1f94751554970190bb8b7266cbf..b8d3b47bb8816061a1c257defa40365630a98f71 100644 (file)
@@ -1599,8 +1599,7 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace,
                 * own children, it should create a separate process which
                 * takes the role of real parent.
                 */
-               if (likely(!ptrace) && p->ptrace &&
-                   same_thread_group(p->parent, p->real_parent))
+               if (likely(!ptrace) && p->ptrace && !ptrace_reparented(p))
                        return 0;
 
                /*