[Samba] Change Filelocking

Urban Widmark urban at teststation.com
Tue Jul 16 03:59:02 GMT 2002

On Tue, 16 Jul 2002, Kestutis Saldziunas wrote:

> Hello,
> According to Urban answer I understood that if one user open file she/he
> must get Oplock (of course if share supports oplock deature). However I
> always in that case get Oplock NONE. Where could be the problem ?
> Pid    DenyMode          Access      R/W        Oplock           Name
> 3568   DENY_NONE  0x2019f     RDWR       NONE             /doc/file.doc

Not necessarily any problem at all. The smb client[1] decides if it wants
to request the oplock or not, I didn't mean to say that the client must
get an oplock.

> I use Samba 2.2.4
> parameters oplock = yes
> level2 oplocks = yes

I think the default for samba is to support oplocks. You shouldn't need to
configure anything. As always there is a more recent version, 2.2.5, maybe
you are being bitten by some 2.2.4 bug.

ethereal is a *really* nice tool for looking at what is sent on the wire.
It has a nice smb decoder that explains most of the packet contents in
detail. Just listen on port 139 while you access the share[2].

It should allow you to answer the following questions:
  Does the client request oplocks when it opens the file?
  Does the server grant the oplock in the response?
  Does the server later send an oplock break?


[1] - Client meaning the client OS in most cases. I don't know if
      windows applications normally can control if oplocks are requested.

[2] - ethereal can read tcpdump captures too. So on a remote server you
      can run:
         tcpdump -w /tmp/tracefile -s 1600 port 139
      and then look at the 'tracefile' on your local machine.

More information about the samba mailing list