From 607acf00deb7f44bb536300e35a8a2995b85509c Mon Sep 17 00:00:00 2001 From: Dinakar Guniguntala Date: Tue, 9 Nov 2004 17:06:41 -0800 Subject: [PATCH] Fix do_wait race Only set the flag in the cases when the exit state is not either TASK_DEAD or TASK_ZOMBIE. (TASK_DEAD or TASK_ZOMBIE will either race or we'll return the information, so no need to note them). I confirmed that this fixes the problem and I also ran some LTP tests Signed-off-by: Dinakar Guniguntala Signed-off-by: Sripathi Kodi Signed-off-by: Linus Torvalds --- kernel/exit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/exit.c b/kernel/exit.c index 4f22175f601b..1cf910bde58a 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1335,14 +1335,15 @@ repeat: ret = eligible_child(pid, options, p); if (!ret) continue; - flag = 1; switch (p->state) { case TASK_TRACED: + flag = 1; if (!my_ptrace_child(p)) continue; /*FALLTHROUGH*/ case TASK_STOPPED: + flag = 1; if (!(options & WUNTRACED) && !my_ptrace_child(p)) continue; @@ -1377,6 +1378,7 @@ repeat: goto end; break; } + flag = 1; check_continued: if (!unlikely(options & WCONTINUED)) continue; -- cgit v1.2.3