Skip to content

Commit

Permalink
ptrace: wait_consider_task: s/same_thread_group/ptrace_reparented/
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oleg Nesterov committed Jun 27, 2011
1 parent bb3696d commit 479bf98
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit 479bf98

Please sign in to comment.