* [Cluster-devel] libdlm: Don't pass LKF_WAIT to the kernel
@ 2008-03-19 20:33 Joel Becker
0 siblings, 0 replies; only message in thread
From: Joel Becker @ 2008-03-19 20:33 UTC (permalink / raw)
To: cluster-devel.redhat.com
libdlm is passing LKF_WAIT to the kernel. In the kernel, the unlock
path strictly audits flags, and errors on this unknown (to the kernel)
flag. The correct answer is to keep the flag in userspace.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
--- a/dlm/lib/libdlm.c 2008-01-16 09:25:48.000000000 -0800
+++ b/dlm/lib/libdlm.c 2008-03-19 13:30:21.000000000 -0700
@@ -754,7 +754,7 @@ static int ls_lock_v5(dlm_lshandle_t ls,
req->cmd = DLM_USER_LOCK;
req->i.lock.mode = mode;
- req->i.lock.flags = flags;
+ req->i.lock.flags = (flags & ~LKF_WAIT);
req->i.lock.lkid = lksb->sb_lkid;
req->i.lock.parent = parent;
req->i.lock.lksb = lksb;
@@ -822,7 +822,7 @@ static int ls_lock_v6(dlm_lshandle_t ls,
req->cmd = DLM_USER_LOCK;
req->i.lock.mode = mode;
- req->i.lock.flags = flags;
+ req->i.lock.flags = (flags & ~LKF_WAIT);
req->i.lock.lkid = lksb->sb_lkid;
req->i.lock.parent = parent;
req->i.lock.lksb = lksb;
@@ -1014,7 +1014,7 @@ static int ls_unlock_v5(struct dlm_ls_in
set_version_v5(&req);
req.cmd = DLM_USER_UNLOCK;
req.i.lock.lkid = lkid;
- req.i.lock.flags = flags;
+ req.i.lock.flags = (flags & ~LKF_WAIT);
req.i.lock.lksb = lksb;
req.i.lock.castparam = astarg;
/* DLM_USER_UNLOCK will default to existing completion AST */
@@ -1035,7 +1035,7 @@ static int ls_unlock_v6(struct dlm_ls_in
set_version_v6(&req);
req.cmd = DLM_USER_UNLOCK;
req.i.lock.lkid = lkid;
- req.i.lock.flags = flags;
+ req.i.lock.flags = (flags & ~LKF_WAIT);
req.i.lock.lksb = lksb;
req.i.lock.namelen = 0;
req.i.lock.castparam = astarg;
--
Life's Little Instruction Book #24
"Drink champagne for no reason at all."
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-03-19 20:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-19 20:33 [Cluster-devel] libdlm: Don't pass LKF_WAIT to the kernel Joel Becker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).