Word and Excel need byte range locking, don't they

Richard Sharpe rsharpe at richardsharpe.com
Thu May 27 17:49:00 GMT 2004


> On Thu, 27 May 2004, Jeremy Allison wrote:
>
> > On Thu, May 27, 2004 at 10:12:41AM -0700, Richard Sharpe wrote:
> > > Hi,
> > >
> > > This would be funny if it weren't so sad.
> > >
> > > When word opens a file there is an enormous amount of activity. It opens
> > > the file, reads it, closes it, opens it again, and so on. At some point it
> > > takes out byte-range locks way beyond the end of the file (OLE?) and
> > > unlocks a different range of bytes also beyond the end of the file.
> > >
> > > So, you need byte range locks, or do you? (Don't ask why this question
> > > arose, just read between the lines.)
> > >
> > > It turns out that there are two different ways to avoid the need for byte
> > > range locks (ie, you can return STATUS_NOT_IMPLEMENTED and get away with
> > > it) at least for Word and Excel.
> > >
> > > At some point during the dance that word does with the file server, it
> > > opens the same file a second time and asks for an OpLock on the file
> > > again. As long as Word gets the OpLock on the first file, and it is broken
> > > on the second open, refusing the byte-range lock does not matter.
> > >
> > > Even more interesting, returning STATUS_SHARING_VIOLATION on the second
> > > open also allows Word to work without the need for byte-range locks.
> >
> > Ok, so do we have a bug here ? This is unclear in your message :-)

No, Samba does not have a bug. It works fine, as far as I can tell.

Regards
-----
Richard Sharpe, rsharpe[at]richardsharpe.com, rsharpe[at]samba.org,
sharpe[at]ethereal.com, http://www.richardsharpe.com


More information about the samba-technical mailing list