aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDinakar Guniguntala <dino@in.ibm.com>2004-11-09 17:06:41 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-09 17:06:41 -0800
commit607acf00deb7f44bb536300e35a8a2995b85509c (patch)
treeddfccd5379f0f9231241c63023f1ffcaff6d3697 /kernel
parentd9621fa0a714dd039daaf171cdd57cde412d7cbf (diff)
downloadhistory-607acf00deb7f44bb536300e35a8a2995b85509c.tar.gz
[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 <dino@in.ibm.com> Signed-off-by: Sripathi Kodi <sripathik@in.ibm.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/exit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 4f22175f601b67..1cf910bde58a8d 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;