Commit 42dc1601 authored by David Teigland's avatar David Teigland

dlm: reject normal unlock when lock is waiting for lookup

Non-forced unlocks should be rejected if the lock is waiting on the
rsb_lookup list for another lock to establish the master node.
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent c54e04b0
...@@ -2110,18 +2110,19 @@ static int validate_unlock_args(struct dlm_lkb *lkb, struct dlm_args *args) ...@@ -2110,18 +2110,19 @@ static int validate_unlock_args(struct dlm_lkb *lkb, struct dlm_args *args)
/* an lkb may be waiting for an rsb lookup to complete where the /* an lkb may be waiting for an rsb lookup to complete where the
lookup was initiated by another lock */ lookup was initiated by another lock */
if (args->flags & (DLM_LKF_CANCEL | DLM_LKF_FORCEUNLOCK)) {
if (!list_empty(&lkb->lkb_rsb_lookup)) { if (!list_empty(&lkb->lkb_rsb_lookup)) {
if (args->flags & (DLM_LKF_CANCEL | DLM_LKF_FORCEUNLOCK)) {
log_debug(ls, "unlock on rsb_lookup %x", lkb->lkb_id); log_debug(ls, "unlock on rsb_lookup %x", lkb->lkb_id);
list_del_init(&lkb->lkb_rsb_lookup); list_del_init(&lkb->lkb_rsb_lookup);
queue_cast(lkb->lkb_resource, lkb, queue_cast(lkb->lkb_resource, lkb,
args->flags & DLM_LKF_CANCEL ? args->flags & DLM_LKF_CANCEL ?
-DLM_ECANCEL : -DLM_EUNLOCK); -DLM_ECANCEL : -DLM_EUNLOCK);
unhold_lkb(lkb); /* undoes create_lkb() */ unhold_lkb(lkb); /* undoes create_lkb() */
}
/* caller changes -EBUSY to 0 for CANCEL and FORCEUNLOCK */
rv = -EBUSY; rv = -EBUSY;
goto out; goto out;
} }
}
/* cancel not allowed with another cancel/unlock in progress */ /* cancel not allowed with another cancel/unlock in progress */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment