Oplock question/problem ???

Jeremy Allison jallison at whistle.com
Thu Feb 12 18:08:47 GMT 1998


Jesse Book Jr wrote:
> 
>        My Problem...  When the files are saved to my samba share I can not
> acces the files because they show that they are still locked.  If I wait
> the locks will eventually disappear, but with the writers having deadlines
> for delivery it makes it important for me to access the files as soon as
> they are available.  Turning off the oplocks makes it possible to access
> the files immediately.
>         My Question...  Is this normal behavior for oplocks?  I was under the
> impression that when the file was closed, or the application terminated the
> file's lock should die as well.

What client OS are you using ? The Win95 redirector has a nasty 
habit of keeping batch oplocked files open long after the application
has actually closed the file. WinNT seems to suffer less than this.

Hmmmm. What you could do to get the current version of the
file (and break the oplock) is to use smbclient to connect
to the Samba server and then copy the file to another name
(probably where you want to put it anyway). This will
force the client to break the oplock. I used this to
break oplocks on demand when developing the oplock code.

The only downside is you cannot be absolutely sure that
the person has finished editing the file at that point,
as the Windows redirector is hiding that from you.

Maybe I should add a 'break oplock after XX minutes
of inactivity parameter'..... Hmmmmm. That might make
some things a lot slower though.

Jeremy Allison,
Samba Team.

-- 
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------


More information about the samba mailing list