share modes /locking in samba

Jeremy Allison jeremy at
Sat Jul 29 00:37:15 GMT 2000

Fraser Campbell wrote:
> The application is written in MS Basic Professional for DOS version 7 ...
> not precisely certain of that but it is a DOS Basic.  Their lock call
> doesn't seem to actually put any lock on the files.
> They wrote a small test application that simply opens and locks a file.
> They want all access to the file blocked (read and write) but the share
> mode remains DENY_NONE.  Oplocks show up as BATCH+EXCLUSIVE but their
> application doesn't see those (I believe they are Windows specific).

Oplocks. They open the file (no deny mode), client redirector gets an
exclusive oplock, then they lock the file, client redirector
says "hmmm. I have an oplock, no sense in sending it to
the server as I *know* I'm the only opener of this file.

So the server says "no locks". The same thing would happen
on NT. 

Test this with *another* app trying to get a lock on the
same region. The second open should break the oplock,
and before the reply break message the first client will
actually send the lock region command to Samba.


	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-technical mailing list