file locking between win and linux clients

Volker Schurig schurig at
Thu Feb 24 14:31:49 GMT 2005

Dear All,


File locking between linux (NFS) clients runs well, file locking between 
win-clients (SAMBA) runs well, too.

When a linux client has opend a file and the win client tries to open 
this file, too,  then the win client is
NOT able to open the file READABLE - that's not fine but it's acceptable.

When a win client has opened a file and the linux client tries to open 
this file, too,  then the linux client
can read AND WRITE the file. After the access to the file by the linux 
client the win client is not
able to write on HIS file further more - that's no so fine.

Entries in the /proc/locks:

When the linux client opens the file, an additional WRITE entry appears.
When the win client opens the file, an additional READ entry appears.

In the log.smbd I found a corresponding (type = READ) entry of the posix 
locking system:
[2004/12/10 12:15:49, 10] locking/posix.c:is_posix_locked(697)
  is_posix_locked: File test2.sxw, offset = 0, count = 4096, type = READ
[2004/12/10 12:15:49, 10] locking/posix.c:posix_lock_in_range(633)
  posix_lock_in_range: offset_out = 0, count_out = 4096

I'm neither a posix nor locking expert but I'm astonished that obviously
the Samba server uses ONLY a read access on the linux system to access a 

Thanks for your help!


Additional information:

Server: OS: Suse 9.1, Samba: 3.0.2a-51
Clients: Suse 8.1, Windows 2000

Application: StarOffice (win), OpenOffice (linux)

    workgroup =test
    interfaces = eth0
    bind interfaces only = true
    printing = cups
    printcap name = cups
    printer admin = @ntadmin, root, administrator
    map to guest = Bad User

    oplocks = no
    level2 oplocks = No
    kernel oplocks = no
    blocking locks = No

    log level = 10

    locking = yes
    strict locking = yes
    posix locking = yes
    readonly = no

    comment = All users
    path = /home/test
    writeable = Yes
    public = yes

More information about the samba-technical mailing list