Brian Fundakowski Feldman wrote:
> There were zero comments about what order things happen in; in fact,
> the ordering in this case is Just Plain Lame (TM).  It's much more
> correct to explicitly check for fp->f_count == 1.

Not sure what you mean. The commit clearly states that POSIX and BSD 
locking intentionally handled in different ways here. Frankly, I see 
nothing lame in the ordering. The second VOP_ADVLOCK just should be 
moved to fdrop().

> > BTW, I have another little concern with that commit: It make possible for 
> > last close() of a file descriptor to return 0 instead of the error from 
> > VOP_CLOSE(), and the error from VOP_CLOSE() to be ignored.

When a process do closef() on a descriptor "held" by another process 
(by fhold(), e.g. the process do read() on the descriptor), it will 
just return 0 without the call to fo_close(). Then, when the other 
process drop the descriptor, fdrop() call fo_close() but the error is 
thrown away. No?

Dima




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to