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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90089

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.
*/