Locking with CTDB

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Nov 13 11:45:02 GMT 2008


On Thu, Nov 13, 2008 at 12:22:28PM +0100, Henning Henkel wrote:
> I have a ctdb installation running samba on two nodes. The ctdb lock 
> file and a test share A reside on a shared filesystem that supports 
> consistent locking across nodes. When I cifsmount this share from 
> several clients through different server nodes in the ctdb cluster and 
> try to acquire Posix locks on a shared file, locking works as expected. 
> When I set up a second share on a filesystem with (OCFS2-like) locking 
> that is locally consistent only, and cifsmount this share to several 
> clients via different samba servers in the ctdb cluster, I can acquire 
> multiple locks for the same shared file simultaneously.
> 
> That's the thing that makes me a little curious, as I would expect, that 
> samba/ctdb would handle the locking also in the second case. Still, the 
> underlying filesystems locking semantics seem to make the difference, 
> and a lock on the shared filesystem is acquired by samba in any case. Is 
> this the way ctdb is supposed to work, or is there still a bug lurking 
> in my test setup?

No, that is a bug in OCFS2. Cifsmount->Samba uses the Posix
extensions, and in this case Samba just passes the posix
lock requests down to the file system. We do not do the
Posix locking semantics on our own in this case. You might
want to try "unix extensions = no" on the Samba server, but
I am not sure that cifsfs is able to map the app's unix
locks correctly to Windows locks. If it does, you get the
mapped locks correctly handled across the cluster.

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20081113/1e594b56/attachment.bin


More information about the samba-technical mailing list