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
This commit is contained in:
Alfred Perlstein 2002-02-01 19:25:36 +00:00
parent 2b39743941
commit 3865fa138b

View File

@ -182,8 +182,6 @@ dup2(td, uap)
FILEDESC_UNLOCK(fdp);
return (error);
}
if (new != i)
panic("dup2: fdalloc");
/*
* fdalloc() may block, retest everything.
*/