Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Nov 1999 23:57:40 +0300
From:      Dmitrij Tejblum <tejblum@arc.hq.cti.ru>
To:        Brian Fundakowski Feldman <green@FreeBSD.org>
Cc:        Dmitrij Tejblum <tejblum@arc.hq.cti.ru>, "FreeBSD Current Users' list" <freebsd-current@FreeBSD.org>
Subject:   Re: Serious locking problem in CURRENT 
Message-ID:  <199911062057.XAA03228@tejblum.pp.ru>
In-Reply-To: Your message of "Sat, 06 Nov 1999 14:25:50 EST." <Pine.BSF.4.10.9911061424020.54344-100000@green.myip.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199911062057.XAA03228>