cvs commit: src/share/man/man9 lock.9

Robert Watson rwatson at
Fri Aug 25 05:47:51 UTC 2006

On Thu, 24 Aug 2006, Julian Elischer wrote:

> Konstantin Belousov wrote:
>> kib         2006-08-24 10:16:01 UTC
>>  FreeBSD src repository
>>  Modified files:        (Branch: RELENG_6)
>>    share/man/man9       lock.9  Log:
>>  MFC rev.1.14:
>>  Note that LK_UPGRADE may drop the shared lock before taking the
>>  exclusive one.
> excuse my ignorance but I though that the whole aim of an upgrade was to 
> make sure that you did NOT drop it before getting the exclusive lock..( or 
> it fails and you back out and retry)

This is a feature and a bug. :-)

In order to avoid deadlock on upgrade, one of two things must happen:

- The upgrade must be able to fail -- i.e., sx(9)'s sx_try_upgrade().

- A race must be introduced in which the shared lock is released before an
   exclusive lock is acquired -- i.e., lockmgr(9)'s LK_UPGRADE.

Consumers of lockmgr(9) -- specifically, VFS, are aware of this.  Documenting 
it is good, however. :-)

Robert N M Watson
Computer Laboratory
University of Cambridge

More information about the cvs-src mailing list