public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] futex_find_get_task: remove an obscure EXIT_ZOMBIE check
@ 2006-08-21 17:06 Oleg Nesterov
  2006-08-22  0:01 ` Bill Huey
  2006-08-22 10:43 ` Ingo Molnar
  0 siblings, 2 replies; 7+ messages in thread
From: Oleg Nesterov @ 2006-08-21 17:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Ingo Molnar, Thomas Gleixner, Steven Rostedt, linux-kernel

(Compile tested).

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.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 2.6.18-rc4/kernel/futex.c~1_zomb	2006-08-21 18:45:43.000000000 +0400
+++ 2.6.18-rc4/kernel/futex.c	2006-08-21 20:32:48.000000000 +0400
@@ -397,7 +397,7 @@ static struct task_struct * futex_find_g
 		p = NULL;
 		goto out_unlock;
 	}
-	if (p->state == EXIT_ZOMBIE || p->exit_state == EXIT_ZOMBIE) {
+	if (p->exit_state != 0) {
 		p = NULL;
 		goto out_unlock;
 	}


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-08-25 10:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-21 17:06 [PATCH 1/3] futex_find_get_task: remove an obscure EXIT_ZOMBIE check Oleg Nesterov
2006-08-22  0:01 ` Bill Huey
2006-08-22 18:34   ` Oleg Nesterov
2006-08-22 22:03     ` Bill Huey
2006-08-22 10:43 ` Ingo Molnar
2006-08-22 19:10   ` Oleg Nesterov
2006-08-25 10:28     ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox