VOP_RENAME of the future
dillon at apollo.backplane.com
Mon Aug 7 16:00:47 PDT 2006
:It seems then that I was wrong. I misunderstood the meaning of the lock
:flags. I thought LK_RETRY is the way for making the lock acquisition
:blocking, and without that the lock acquisition becomes non-blocking
:and thence fallible.
:Sorry for arguing based on a confused perception of the concepts
This is a very common mistake, and it's really the fault of the lockmgr
code, not you. The original designers of the lockmgr code in their
infinite wisdom made the locking code not retry a blocked lock by
default. It's absolutely the wrong way to do it. So if you do a
lockmgr LK_EXCLUSIVE without LK_RETRY, it will still block, but it
won't retry after it unblocks.
The confusion is exasperated by the fact that you can set LK_RETRY
in the default flags in the lockinit() call, and then not have to
specify it in the lockmgr() call to have it still retry.
I spent gobs of time cleaning up the lockmgr code. The LK_RETRY-as-default
is one bit that I haven't cleaned up yet.
<dillon at xxxxxxxxxxxxx>
More information about the Kernel