Hi,

On Tue, 27 Jul 1999 00:22:10 -0400 (EDT), Alexander Viro
<[EMAIL PROTECTED]> said:

>> The solution I've used is to keep the fdset bit set during the entire
>> dup2().  Both the open and close code already have windows where the
>> fdset bit is set and the fd array is clear.

> That's OK, except that we may get a problem with fork() blindly copying
> both the bitmap and array. Probably not fatal.

Hmm, not fatal but definitely a leak of available fds.  You end up with
a fd which cannot be allocated to open(), but which can't be used either
because there is no file there.  That would appear to be a problem even
without the fdset patches.

The easy solution is for copy_files to clear the entry in the open_fds
bitmap for any fds which aren't fully installed.  The alternative of
fixing the files locking so as not to drop the lock is going to be
rather hard, since open() and dup2() calls the VFS between the bitmap op
and the fd table op.

--Stephen

Reply via email to