share mode locking: behaviour inconsistency.

Paul Jakma paul.jakma at compaq.com
Fri Mar 12 16:06:17 GMT 1999


Hi,

I think there is an inconsistency between the way samba handles share
mode locking, and the way NT does.

We're running samba 2.0.3 on linux 2.0.36. Which is used to share a
couple of files to a small windows application running on several
computers, which uses share mode locking to synchronise writes.

we've noticed the following problem:

[root at nldbd austria]# smbstatus

Samba version 2.0.3
Service      uid      gid      pid     machine
----------------------------------------------
easy         user1  smbusers 27352   machine1 (ip_addr1) Fri Mar 12
15:48
:23 1999

Locked files:
Pid    DenyMode   R/W        Oplock           Name
--------------------------------------------------
27352  DENY_WRITE RDWR       EXCLUSIVE+BATCH  /home/samba/share/loinf
Fri Mar 12 15:52:29 1999

Share mode memory usage (bytes):
   12582384(99%) free + 408(0%) used + 120(0%) overhead = 12582912(100%)
total

If another application tries to open file "loinf" read/write, it fails,
as it should.

however if another application tries to open file "loinf" read only, it
fails! with error string "access denied". Under NT it is possible for a
second application to open the file read_only while the file is locked
DENY_WRITE.

This is causing me problems as I need to serve files to an application
that depends on NT's share mode behaviour. I've tried disabling oplocks
and {dis,en}enabling {kernel,blocking,strict?} locks. it doesn't help.

any ideas? bug in samba's behaviour or NT's behaviour? And are there any
work arounds?

Regards,

Paul Jakma.

PS: please cc: me as I'm not on the list. (yet).

PPS: samba's new domain member code works excellently, am using it to
transparently create home directories for NT users.. great work.



More information about the samba mailing list