[Samba] [SMB 3.0.10] File Locking Mechanism Windows <-> Unix

Asif, M Asif.M at siemens.com
Mon Mar 14 09:42:34 GMT 2005


Hello,

Iam facing a problem in locking of files across samba shares. We have samba
3.0.10 running on Solaris 9 with the smb.conf as follows.

# Global parameters
[global]
       workgroup = NMUINT
        netbios name = NMUINTFS
        interfaces = <IP>
        bind interfaces only = Yes
        security = DOMAIN
        password server = XXX.XXX.XXX.XXX
        log level = 1
        ldap ssl = no
        #oplocks = no
        kernel oplocks = no

[Share1]
        path = /export/home/Testdev/share
        read only = No
        oplocks = no
        strict locking = yes
        level2 oplocks = no


The files under this directory are modified both from Windows and Solaris
programatically. When ever a process accesses a file in this directory, it
opens it in an exclusive mode ( DENY_ALL ). Now, this works fine between two
processes on Windows and between two UNIX process (Gives equivalent of
Winods error  53, File is used by another process) . But this does not work
between Winodws and Unix. i.e Both of them are able to open the file in
exclusive mode!! I ran the 'fuser' command in such a situation ( when both
had exclusive accesses to the file) and to my surprise I found that both
smbd and the unix process are listed

bash-2.05# fuser /export/home/Testdev/share/test.txt
/export/home/Testdev/share/test.txt:     1655o    1567o 

bash-2.05# ps -e | grep filetest
    1655 pts/5    0:00 filetest
bash-2.05# ps -e | grep 1567
1567 ?        0:00 smbd

Also I tried to rename the file when only samba was locking it . The rename
was successful. This is not possible if only unix process (filetest) is
locking it. It will fail with a Permission denied error.

Can any one help me in getting this file lock working? 
Thanking you in anticipation
asif


More information about the samba mailing list