Robert Watson wrote:
> I don't know much (anything) about the advisory locking code, but was
> puzzled to see the following at the bottom of the flock() system call code
> in kern_descrip.c:

[ ... ]

> My reading of that is that the fp->f_flag field will be unconditionally
> updated to include FHASLOCK, even if VOP_ADVLOCK() returns an error.  Is
> this correct?


The FS on which the VOP_ADVLOCK is being called may be a union of two
underlying FS's.

If the lock succeeds on one and fails on the other, you are screwed,
unless you change how the VOP_ADVLOCK semantics are handled.

Backing out the lock on the FS that succeeds doesn't work because of
lock coelescing, and the fact that it is not delayed until both have
succeeded or failed.  It means that if your attempted lock intersects
any preexiting lock, you will have an irreversible promotion or
demotion of the lock, and that simply removing the lock could remove
locking that should remain asserted (after all, the call is reporting
that the state has not changed).

-- Terry

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

Reply via email to