From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joel Becker Date: Wed, 19 Mar 2008 13:33:51 -0700 Subject: [Cluster-devel] libdlm: Don't pass LKF_WAIT to the kernel Message-ID: <20080319203351.GA23815@mail.oracle.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- 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