File lock test

Jeremy Allison jallison at
Fri Jan 30 23:46:05 GMT 1998

Simon Hyde wrote:
> Samba often (depending on the architecture) stores locks in shared memory,
> therefore in order to view currently locked files you'll have to use
> smbstatus to list locks.

Errrr - that's not strictly true. Samba stores
'DENY' modes and oplocks in shared memory. Actual
file locks it uses the system fcntl() calls so they
are 'stored' (if that's the right word) in the
kernel along with all other system file locks.

smbstatus is showing you the current deny modes
and oplocks set on all open files, not the file

Deny modes are *NOT* file locks (oplocks aren't
file locks either, but that's another story).

There is a section on what deny modes are
in UNIX-SMB.txt and in UNIX_INSTALL.txt 
in the Samba docs/ directory (search for
the word 'DENY' in the file). There is
no real analogue for deny modes in UNIX,
so that's why people often confuse them
with file locks (as that's the closest 
thing UNIX has).

There should also be a good explaination of 
this in the upcoming Samba book written by John

Hope this helps,

	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