]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - fs/dlm/lock.c
dlm: adopt orphan locks
authorDavid Teigland <teigland@redhat.com>
Fri, 17 Oct 2014 16:05:50 +0000 (11:05 -0500)
committerDavid Teigland <teigland@redhat.com>
Wed, 19 Nov 2014 20:48:02 +0000 (14:48 -0600)
commit2ab4bd8ea3a6954bc79a9bbeb291cd6c2d6213a7
treec15e4590760ba76c29f2fca34c1b1edf82186cbd
parent206c5f60a3d902bc4b56dab2de3e88de5eb06108
dlm: adopt orphan locks

A process may exit, leaving an orphan lock in the lockspace.
This adds the capability for another process to acquire the
orphan lock.  Acquiring the orphan just moves the lock from
the orphan list onto the acquiring process's list of locks.

An adopting process must specify the resource name and mode
of the lock it wants to adopt.  If a matching lock is found,
the lock is moved to the caller's 's list of locks, and the
lkid of the lock is returned like the lkid of a new lock.

If an orphan with a different mode is found, then -EAGAIN is
returned.  If no orphan lock is found on the resource, then
-ENOENT is returned.  No async completion is used because
the result is immediately available.

Also, when orphans are purged, allow a zero nodeid to refer
to the local nodeid so the caller does not need to look up
the local nodeid.

Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lock.c
fs/dlm/lock.h
fs/dlm/user.c
include/uapi/linux/dlmconstants.h