[Samba] A samba locking question

Patrik Gustavsson Patrik.Gustavsson at Sun.COM
Wed Feb 4 09:29:59 GMT 2004


If I get this wright is that Samba will not use
a direct call to fcnl() to lock the file.

If a PC open a file and do lock that file, will that
lock be propagated so other application on the server can see that
file is locked by calling fcntl().


On lör, 2004-01-31 at 01:24, Andrew Bartlett wrote:
> On Thu, 2004-01-29 at 23:55, Patrik Gustavsson wrote:
> > Hi,
> > 
> > Maybe this is a stupid question, but any way
> > 
> > Will samba use fcntl locking if level 1 and 2 oplocks is
> > disabled and samba is not compiled with spin-locks enabled ?
> > 
> > I am using Samba on solaris
> Samba uses fcntl() locking in two places.  Firstly, it is used to mirror
> SMB locks, asked for by the client.  Secondly they are used to mediate
> access to tdbs.
> Spinlocks are an alternative (if much less reliable) method for tdb
> mediation.  
> oplocks do not override fcntl locks - but clients that have successfully
> gained an oplock might not ask for an SMB lock, and therefore Samba
> might not attempt to gain the matching fcntl() lock.
> The nasty performance issues in Solaris are due to bad fcntl() lock
> contention performance in Samba's TDB access.  
> Andrew Bartlett
"In a world without fences who needs Gates"
Patrik Gustavsson, Senior Technical Consultant
patrik.gustavsson at sun.com     Telephone: +46 60 671540
http://glen.sweden            Mobile: +46 70 3551040
SUN MICROSYSTEMS              Fax: +46 60 671550

More information about the samba mailing list