Skip to content

Commit

Permalink
wait_task_zombie: don't fight with non-existing race with a dying ptr…
Browse files Browse the repository at this point in the history
…acee

The "p->exit_signal == -1 && p->ptrace == 0" check and the comment are
bogus.  We already did exactly the same check in eligible_child(), we did
not drop tasklist_lock since then, and both variables need
write_lock(tasklist) to be changed.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Oct 17, 2007
1 parent ebca4cd commit 442a10c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1189,13 +1189,6 @@ static int wait_task_zombie(struct task_struct *p, int noreap,
BUG_ON(state != EXIT_DEAD);
return 0;
}
if (unlikely(p->exit_signal == -1 && p->ptrace == 0)) {
/*
* This can only happen in a race with a ptraced thread
* dying on another processor.
*/
return 0;
}

/* traced means p->ptrace, but not vice versa */
traced = (p->real_parent != p->parent);
Expand Down

0 comments on commit 442a10c

Please sign in to comment.