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:
parent
2b39743941
commit
3865fa138b
@ -182,8 +182,6 @@ dup2(td, uap)
|
||||
FILEDESC_UNLOCK(fdp);
|
||||
return (error);
|
||||
}
|
||||
if (new != i)
|
||||
panic("dup2: fdalloc");
|
||||
/*
|
||||
* fdalloc() may block, retest everything.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user