History

[PATCH] futex_find_get_task(): remove an obscure EXIT_ZOMBIE check

futex_find_get_task: if (p->state == EXIT_ZOMBIE || p->exit_state == EXIT_ZOMBIE) return NULL; I can't understand this. First, p->state can't be EXIT_ZOMBIE. The ->exit_state check looks strange too. Sub-threads or tasks whose ->parent ignores SIGCHLD go directly to EXIT_DEAD state (I am ignoring a ptrace case). Why EXIT_DEAD tasks should be ok? Yes, EXIT_ZOMBIE is more important (a task may stay zombie for a long time), but this doesn't mean we should explicitely ignore other EXIT_XXX states.

Oleg Nesterov committed 20 years ago

Commit d015bae1 parent 533475d1 file · +1 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/futex.c+1−1
@@ -397,7 +397,7 @@ static struct task_struct * futex_find_get_task(pid_t pid) · 396 unmodified lines
397 p = NULL;397 p = NULL;
398 goto out_unlock;398 goto out_unlock;
399 }399 }
400 if (p->state == EXIT_ZOMBIE || p->exit_state == EXIT_ZOMBIE) {400 if (p->exit_state != 0) {
401 p = NULL;401 p = NULL;
402 goto out_unlock;402 goto out_unlock;
403 }403 }