[AFS3-std] Proposal: Extension of RXAFS_SetLock to support LockUpgrade and LockDowngrade

Jeffrey Altman jaltman@secure-endpoints.com
Sat Feb 25 00:23:33 EST 2006


The RXAFS_SetLock RPC currently supports four operations:

%#define LockRead               0
%#define LockWrite              1
%#define LockExtend             2
%#define LockRelease            3

This set of operations does not provide the functionality
necessary in order to safely support the upgrading of a read
lock to the write lock and the downgrading of a write lock to
a read lock.  Currently, upgrades and downgrades are implemented
in the afs client by dropping a lock and requesting the other
type.  Unfortunately, this creates a race condition which can
result in the loss of the lock in its entirety.

To remove the race condition two additional operations are
proposed for the existing RXAFS_SetLock RPC:

%#define LockUpgrade            4
%#define LockDowngrade          5

Extending the existing RPC is safe to do because the existing
implementations currently return EINVAL for these values.

The semantics of the new operations are as follows:

  LockUpgrade - if there is only one lock issued and it is of
  type "Read", then change the lock type to "Write" and return
  success.  Otherwise, return EAGAIN.

  LockDowngrade - if there is only one lock issued and it is of
  type "Write", then change the lock type to "Read" and return
  success.  Otherwise, return EAGAIN.

In both cases, a successful completion of the operation updates
the lock issuance time to the current time.

In order to avoid the need to issue try the new operations and
fallback to the old release and lock approach, a Capability flag
VICED_CAPABILITY_LOCK_UPGRADES will be created using a number assigned
by registrar@grand.central.org.

Jeffrey Altman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3288 bytes
Desc: S/MIME Cryptographic Signature
Url : http://michigan-openafs-lists.central.org/archives/afs3-standardization/attachments/20060225/700043b9/smime.bin


More information about the AFS3-standardization mailing list