Commit c795b33b authored by Goldwyn Rodrigues's avatar Goldwyn Rodrigues Committed by Joel Becker

ocfs2/dlm: Wait on lockres instead of erroring cancel requests

In case a downconvert is queued, and a flock receives a signal,
BUG_ON(lockres->l_action != OCFS2_AST_INVALID) is triggered
because a lock cancel triggers a dlmunlock while an AST is
scheduled.

To avoid this, allow a LKM_CANCEL to pass through, and let it
wait on __dlm_wait_on_lockres().
Signed-off-by: default avatarGoldwyn Rodrigues <rgoldwyn@suse.de>
Acked-off-by: default avatarMark Fasheh <mfasheh@suse.com>
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
parent a8b88d3d
...@@ -122,7 +122,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm, ...@@ -122,7 +122,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
* that still has AST's pending... */ * that still has AST's pending... */
in_use = !list_empty(&lock->ast_list); in_use = !list_empty(&lock->ast_list);
spin_unlock(&dlm->ast_lock); spin_unlock(&dlm->ast_lock);
if (in_use) { if (in_use && !(flags & LKM_CANCEL)) {
mlog(ML_ERROR, "lockres %.*s: Someone is calling dlmunlock " mlog(ML_ERROR, "lockres %.*s: Someone is calling dlmunlock "
"while waiting for an ast!", res->lockname.len, "while waiting for an ast!", res->lockname.len,
res->lockname.name); res->lockname.name);
...@@ -131,7 +131,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm, ...@@ -131,7 +131,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
spin_lock(&res->spinlock); spin_lock(&res->spinlock);
if (res->state & DLM_LOCK_RES_IN_PROGRESS) { if (res->state & DLM_LOCK_RES_IN_PROGRESS) {
if (master_node) { if (master_node && !(flags & LKM_CANCEL)) {
mlog(ML_ERROR, "lockres in progress!\n"); mlog(ML_ERROR, "lockres in progress!\n");
spin_unlock(&res->spinlock); spin_unlock(&res->spinlock);
return DLM_FORWARD; return DLM_FORWARD;
......
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