[Samba] samba does not lock files

Jeremy Allison jra at samba.org
Tue Mar 28 16:45:53 GMT 2006


On Tue, Mar 28, 2006 at 03:25:26AM +0000, Douglas D. Germann, Sr. wrote:
> Adam--
> 
> You are a wonder worker!
> 
> I entered your command and the response I got was--
> 
> libgnomevfs-2.so.0 => /usr/lib/libgnomevfs-2.so.0 (0xb7b53000)
> 
> which I suspect is pretty much what you expected. Right?
> 
> In any case, after reading HOWTOs and man files and README files I edited
> /etc/fstab and changed the instances of smbfs to cifs. It mounted right away,
> and the files now lock linux to linux and linux to winXP Pro.
> 
> (At least for OOo. KWord does not respect the locks, nor does gedit. I suspect
> that will not be a problem, but I wonder why not?)
> 
> Thank you, thank you, thank you! Adam you have rescued me from having spent 2
> 1/2 weeks of work till midnight trying to get some file locking going! You are a
> wonder, Adam!

I downloaded and looked through the OO code on Linux to understand
what it does to lock a file. It tries to take a fcntl write lock
over the entire file, and uses this to determine if the file is
being shared. This means it should interoperate correctly (at
least on Linux with kernel oplocks) with OO or Microsoft Office
running on Windows clients (ie. they'll see each others locks).

gedit or kword probably don't look at the locks at all, and
as they're advisory not mandatory then they will not see any
conflicts.

Jeremy.


More information about the samba mailing list