ocfs2/dlm: Wait on lockres instead of erroring cancel requests
PATCH 1/1 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().
---
fs/ocfs2/dlm/dlmunlock.c +0 -0
@@ -122,7 +122,7 @@ static enum dlm_status dlmunlock_common(struct
dlm_ctxt *dlm,
* that still has AST's pending... */
in_use = !list_empty(&lock->ast_list); spin_unlock(&dlm->ast_lock);
- if (in_use) {
+ if (in_use && !(flags & LKM_CANCEL)) {
mlog(ML_ERROR, "lockres %.*s: Someone is calling dlmunlock "
"while waiting for an ast!", res->lockname.len, res->lockname.name);
@@ -131,7 +131,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
spin_lock(&res->spinlock);
if (res->state & DLM_LOCK_RES_IN_PROGRESS) {
- if (master_node) {
+ if (master_node && !(flags & LKM_CANCEL)) {
mlog(ML_ERROR, "lockres in progress!\n"); spin_unlock(&res->spinlock); return DLM_FORWARD;
PATCH 1/1 ocfs2/dlm: Wait on lockres instead of erroring cancel requests
Quoted 41 lines · Goldwyn Rodrigues
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_CANCELto pass through, and let it wait on__dlm_wait_on_lockres().Signed-off-by Goldwyn Rodrigues <[email protected]>Signed-off-by Mark Fasheh <[email protected]>---
fs/ocfs2/dlm/dlmunlock.c +1
-1@@ -122,7 +122,7 @@ static enum dlm_status dlmunlock_common(structdlm_ctxt *dlm, * that still has AST's pending... */ in_use = !list_empty (&lock->ast_list);spin_unlock (&dlm->ast_lock); -if (in_use) { +if (in_use && !(flags &LKM_CANCEL )) { mlog(ML_ERROR, "lockres %.*s: Someone is calling dlmunlock " "while waiting for an ast!", res->lockname.len,fs/ocfs2/dlm/dlmunlock.c +1
-1res->lockname.name);@@ -131,7 +131,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,spin_lock (&res->spinlock);if (res->state &DLM_LOCK_RES_IN_PROGRESS ) { -if (master_node) { +if (master_node && !(flags &LKM_CANCEL )) {mlog (ML_ERROR ,"lockres in progress!\n" );spin_unlock (&res->spinlock);return
DLM_FORWARD;_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
http://oss.oracle.com/mailman/listinfo/ocfs2-devel
PATCH 1/1 ocfs2/dlm: Wait on lockres instead of erroring cancel requests
In reply to Goldwyn RodriguesQuoted 10 lines · Goldwyn Rodrigues
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_CANCELto pass through, and let it wait on__dlm_wait_on_lockres().Signed-off-by Goldwyn Rodrigues <[email protected]>Signed-off-by Mark Fasheh <[email protected]>
This patch is now part of the fixes branch of ocfs2.git.
Joel
Signature · 8 lines
"Friends may come and go, but enemies accumulate."
- Thomas Jones
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127