ocfs2/dlm: a missing DLM_LOCK_RES_IN_PROGRESS set
PATCH 1/1 ocfs2/dlm: a missing DLM_LOCK_RES_IN_PROGRESS set
For remote dlm operations, local node sets DLM_LOCK_RES_IN_PROGRESS flag on the lockres to prevent parallel remote dlm requests.
There is a miss of setting that flag in dlmunlock_common() for the remote case which leads to a later remote dlm request goes on.
Signed-off-by Wengang Wang <[email protected]>
--- fs/ocfs2/dlm/dlmunlock.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)
fs/ocfs2/dlm/dlmunlock.c +8 -3
@@ -104,7 +104,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm, {enum dlm_status status;int actions =0 ; -int in_use; +int in_use, can_block;u8 owner; mlog(0, "master_node = %d, valblk = %d\n", master_node,
@@ -127,9 +127,10 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,return DLM_BADPARAM ; } + can_block = master_node? (flags &LKM_CANCEL ) :1 ;spin_lock (&res->spinlock);if (res->state &DLM_LOCK_RES_IN_PROGRESS ) { -if (master_node && !(flags &LKM_CANCEL )) { +if (!can_block) {mlog (ML_ERROR ,"lockres in progress!\n" );spin_unlock (&res->spinlock);return DLM_FORWARD ;
@@ -137,6 +138,9 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,/* ok for this to sleep if not in a network handler */ __dlm_wait_on_lockres (res); res->state |=DLM_LOCK_RES_IN_PROGRESS ; + }else { +if (can_block) + res->state |=DLM_LOCK_RES_IN_PROGRESS ; }spin_lock (&lock->spinlock);
@@ -232,7 +236,8 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,dlm_lock_put (lock); leave: - res->state &= ~DLM_LOCK_RES_IN_PROGRESS ; +if (can_block) + res->state &= ~DLM_LOCK_RES_IN_PROGRESS ;if (!dlm_lock_on_list (&res->converting, lock))BUG_ON (lock->ml.convert_type !=LKM_IVMODE );else
Signature · 1 line
1.7.2.3
PATCH 1/1 ocfs2/dlm: a missing DLM_LOCK_RES_IN_PROGRESS set
A reminder.
thanks,
wengang.
Quoted 63 lines · Wengang Wang
For remote dlm operations, local node sets
DLM_LOCK_RES_IN_PROGRESSflag on the lockres to prevent parallel remote dlm requests.
There is a miss of setting that flag indlmunlock_common()for the remote case which leads to a later remote dlm request goes on.Signed-off-by Wengang Wang <[email protected]>--- fs/ocfs2/dlm/dlmunlock.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)fs/ocfs2/dlm/dlmunlock.c +8
-3@@ -104,7 +104,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm, {enum dlm_status status;int actions =0 ; -int in_use; +int in_use, can_block;u8 owner; mlog(0, "master_node = %d, valblk = %d\n", master_node,@@ -127,9 +127,10 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,return DLM_BADPARAM ; } + can_block = master_node? (flags &LKM_CANCEL ) :1 ;spin_lock (&res->spinlock);if (res->state &DLM_LOCK_RES_IN_PROGRESS ) { -if (master_node && !(flags &LKM_CANCEL )) { +if (!can_block) {mlog (ML_ERROR ,"lockres in progress!\n" );spin_unlock (&res->spinlock);return DLM_FORWARD ;@@ -137,6 +138,9 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,/* ok for this to sleep if not in a network handler */ __dlm_wait_on_lockres (res); res->state |=DLM_LOCK_RES_IN_PROGRESS ; + }else { +if (can_block) + res->state |=DLM_LOCK_RES_IN_PROGRESS ; }spin_lock (&lock->spinlock);@@ -232,7 +236,8 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,dlm_lock_put (lock); leave: - res->state &= ~DLM_LOCK_RES_IN_PROGRESS ; +if (can_block) + res->state &= ~DLM_LOCK_RES_IN_PROGRESS ;if (!dlm_lock_on_list (&res->converting, lock))BUG_ON (lock->ml.convert_type !=LKM_IVMODE );else Signature · 7 lines
1.7.2.3 _______________________________________________ Ocfs2-devel mailing list Ocfs2-devel at oss.oracle.com http://oss.oracle.com/mailman/listinfo/ocfs2-devel