On 3/18/2011 9:29 AM, Thomas Smith wrote:
> Hi,
> 
> Is it possible to open files read-only when another process has a
> write-lock? I found the following information regarding 1.5.20.
> 
>     http://dl.openafs.org/dl/openafs/1.5.20/winxp/relnotes.htm

The release notes for the version of the OpenAFS client that is
installed on the machine in question is available locally

  Start->Programs->OpenAFS->Documentation->Release Notes

>         Many applications on Windows (e.g. Microsoft Office) require
> the use of byte range locks
>         applied to a file either to protect against simultaneous file
> access or as a signaling mechanism.
>         OpenAFS for Windows release 1.5 (or greater) implements byte
> range locking within the
>         CIFS-AFS gateway server.   This support for byte range locking
> obtains AFS’ advisory file
>         server locks to simulate Microsoft Windows mandatory locks.
> When an application opens
>         a file, a lock will be obtained from AFS indicating that the
> file is in use.  If the lock is a write
>         lock, access to the file will be restricted to other
> applications running on the same machine
>         as the first application to request the lock. Applications
> running on other machines will see
>         the AFS full file lock and will be unable to access the file.
> 
> Just wasn't sure if this is the current state things.

It is.

> I'm on 1.4.12 on the server and 1.5.78 on the client.
> 
> This issue arose when one of my users was editing a spreadsheet and
> another user attempted to open the same spreadsheet for viewing--the
> attempted viewer received an error indicating that the file was
> locked.

As described above, Microsoft Office applications use byte range locks
as a form of signaling.  When an Office application requests a file be
opened in read-only mode it obtains a shared byte-range lock on a
particular section of the file.  That permits other instances of Office
on the network to know that the file is open for read-only use and it
should not be changed.

This model works just fine on AFS if both instances are sitting behind
the same AFS cache manager since the cache manager can manage the byte
range lock allocations.  However, it fails if the instances are on
different machines because the AFS file servers do not support
byte-range locking.

Jeffrey Altman


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to