posix locking on OCFS2

Michael Adam obnox at samba.org
Sun Nov 23 10:34:37 MST 2014


On 2014-11-23 at 12:28 +0000, Rowland Penny wrote:
> OK, getting confused now
> 
> Amitay posted this link:
> 
> https://oss.oracle.com/osswiki/OCFS2/NewFeaturesList.html
> 
> Which has this:
> 
> Cluster aware flock(2)
> 
>     Required Kernel: Linux 2.6.26
> 
>     Required Tools: Any
> 
> The flock(2) system call is now cluster aware. File locks taken on one node
> from userspace will interact with those taken on other nodes. All flock(2)
> options are supported, including the kernels ability to cancel a lock
> request when an appropriate kill signal is recieved by the user.
> Unfortunately, POSIX file locks, also known as lockf(3) or fcntl(2) locks
> are not yet supported in a cluster manner. We hope to have that ready in an
> upcoming version of Ocfs2.
> 
> It also has this:
> 
> Cluster aware POSIX file locks (fcntl(), lockf())
> 
>     Required Kernel: Linux 2.6.28
> 
>     Required Tools: Any - userspace cluster stack required
> 
> POSIX locks are now cluster aware. Locks taken on one node will interact
> with those taken on another node. Due to the group communication required to
> make these locks coherent, a userspace cluster is required.
> 
> What is the difference between fcntl() & fcntl(2), also lockf() & lockf(3)
> ???? Which is required ???

If you want ctdbd to do split brain prevention via a recovery lock
on a cluster file system, the file system needs to support the
byte range locking calls of fcntl (F_SETLK, F_UNLCK, ...). See
the manual page of fcntl. For the differences of the other calls,
you can also consult their man pages. Basically variants of doing
locks.

The number in parentheses is the manual page section.
For instance, there is a command line tool called flock
(section 1). And the C-function flock (section 2).
This parenthesis notation is just a convenient way to
identify one, i.e. flock(1) refers to the command line tool
and flock(2) refers to the C-function. You can look at the
corresponding man pages with "man 1 flock" and "man 2 flock".
And so on.

> According to Steve, CTDB does not work,

Since those who should know confirmed that OCFS2
has sufficient support for fcntl locks to support
ctdb's recovery lock, I assume that steve has
a misconfiguration of some kind. Just stating that
it does not work is by the way not precise enough.

Until we get

- precise versions of software used (file system, ctdb, ...)
- exact description of what fails
- configuration (ctdb, file system, ...)
- logs (ctdb, syslog/file system ...)

we can't say what is going wrong.


> if this is so and I have no reason to believe he is lying
> (I mean, why would he, what would he gain???),
> the problem needs to be identified

Right, and for that we need the above data (at least).

> and documented until it is fixed.

... or hints how to amend steve's setup.

Cheers - Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141123/64d72a1d/attachment.pgp>


More information about the samba-technical mailing list