Commit c543f1ee authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

wait_task_zombie: remove ->exit_state/exit_signal checks for WNOWAIT

The first "p->exit_state != EXIT_ZOMBIE" check doesn't make too much sense.
The exit_state was EXIT_ZOMBIE when the function was called, and another
thread can change it to EXIT_DEAD right after the check.

The second condition is not possible, detached non-traced threads were already
filtered out by eligible_child(), we didn't drop tasklist since then.
Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3a515e4a
...@@ -1196,10 +1196,6 @@ static int wait_task_zombie(struct task_struct *p, int noreap, ...@@ -1196,10 +1196,6 @@ static int wait_task_zombie(struct task_struct *p, int noreap,
int exit_code = p->exit_code; int exit_code = p->exit_code;
int why, status; int why, status;
if (unlikely(p->exit_state != EXIT_ZOMBIE))
return 0;
if (unlikely(p->exit_signal == -1 && p->ptrace == 0))
return 0;
get_task_struct(p); get_task_struct(p);
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
if ((exit_code & 0x7f) == 0) { if ((exit_code & 0x7f) == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment