summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2002-02-01 19:25:36 +0000
committeralfred <alfred@FreeBSD.org>2002-02-01 19:25:36 +0000
commitb616625325513bceaa693d49b5fc523887b0cefd (patch)
tree5f23df667fb1a8e934a8d073cdeb0af878be09ec /sys
parent74f44e9118c6128d583e17eb9c7f6c28741e03b6 (diff)
downloadFreeBSD-src-b616625325513bceaa693d49b5fc523887b0cefd.zip
FreeBSD-src-b616625325513bceaa693d49b5fc523887b0cefd.tar.gz
Remove bogus assertion in dup2 that can lead to panics when kernel
threads race for a file slot. dup2(2) incorrectly assumes that if it needs to grow the ofiles array that it will get what it wants. This assertion was valid before we allowed shared filedescriptor tables but is now incorrect. The assertion can trigger superfolous panics if the thread doing a dup2 looses a race with another thread while possibly blocked in the MALLOC call in fdalloc. Another thread may grab the slot we are requesting which makes fdalloc return something other than what we asked for, this will triggering the bogus assertion. MFC after: 2 weeks Reviewed by: phk
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_descrip.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 7628d5a..7767990 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -182,8 +182,6 @@ retry:
FILEDESC_UNLOCK(fdp);
return (error);
}
- if (new != i)
- panic("dup2: fdalloc");
/*
* fdalloc() may block, retest everything.
*/
OpenPOWER on IntegriCloud