From: Joel Becker <Joel.Becker@oracle.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] libdlm: Don't pass LKF_WAIT to the kernel
Date: Wed, 19 Mar 2008 13:33:51 -0700 [thread overview]
Message-ID: <20080319203351.GA23815@mail.oracle.com> (raw)
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
reply other threads:[~2008-03-19 20:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080319203351.GA23815@mail.oracle.com \
--to=joel.becker@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).