ocfs2: dlmlock_master should return DLM_NORMAL after adding lock to blocked list
PATCH 1/1 ocfs2: dlmlock_master should return DLM_NORMAL after adding lock to blocked list
Function dlmlock_master() returns DLM_RECOVERING/DLM_MIGRATING/ DLM_FORWAR after adding lock to blocked list if lockres has the state DLM_LOCK_RES_RECOVERING/DLM_LOCK_RES_MIGRATING/ DLM_LOCK_RES_IN_PROGRESS. so it will retry in dlmlock(). And this may cause dlm_thread fall into an infinite loop
Thread1 dlm_thread
calls dlm_lock->dlmlock_master,
if lockresA is in stateDLM_LOCK_RES_RECOVERING, calls__dlm_wait_on_lockres() and waits
until others threads clear this
state;
If cannot grant this lock,
adding lock to blocked list,
and return DLM_RECOVERING;
Grant this lock and move it to grant list;
After a while, retry and
calls list_add_tail(), adding lock
to blocked list again.
Granted and blocked list of this lockres will become the following conditions:
lock_res->granted.next = dlm_lock->list_head;
lock_res->blocked.next = dlm_lock->list_head;
dlm_lock->list_head.next = dlm_lock_resource->blocked;When dlm_thread traverses the granted list, it will fall into an endless loop, checking dlm_lock.list_head, dlm_lock->list_head.next (i.e.lock_res->blocked), lock_res->blocked.next(i.e.dlm_lock.list_head again) .....
--- fs/ocfs2/dlm/dlmlock.c | 1 + 1 file changed, 1 insertion(+)
fs/ocfs2/dlm/dlmlock.c +1 -0
@@ -178,6 +178,7 @@ static enum dlm_status dlmlock_master(struct dlm_ctxt *dlm, lock->ml.node); } }else { + status =DLM_NORMAL ;dlm_lock_get (lock);list_add_tail (&lock->list, &res->blocked); kick_thread =1 ;
Signature · 1 line
1.7.9.7
PATCH 1/1 ocfs2: dlmlock_master should return DLM_NORMAL after adding lock to blocked list
it is fine. because when the lock add to the block list. it should be return DLM_NORMAL.
Quoted 52 lines · Xue jiufei
Function
dlmlock_master()returns DLM_RECOVERING/DLM_MIGRATING/DLM_FORWARafter adding lock to blocked list if lockres has the state DLM_LOCK_RES_RECOVERING/DLM_LOCK_RES_MIGRATING/DLM_LOCK_RES_IN_PROGRESS. so it will retry indlmlock(). And this may causedlm_threadfall into an infinite loopThread1
dlm_thread
callsdlm_lock->dlmlock_master,
if lockresA is in stateDLM_LOCK_RES_RECOVERING, calls__dlm_wait_on_lockres()and waits
until others threads clear this
state;If cannot grant this lock,
adding lock to blocked list,
and returnDLM_RECOVERING;Grant this lock and move it to grant list;
After a while, retry and
callslist_add_tail(), adding lock
to blocked list again.Granted and blocked list of this lockres will become the following conditions:
lock_res->granted.next = dlm_lock->list_head; lock_res->blocked.next = dlm_lock->list_head; dlm_lock->list_head.next = dlm_lock_resource->blocked;When
dlm_threadtraverses the granted list, it will fall into an endless loop, checking dlm_lock.list_head,dlm_lock->list_head.next(i.e.lock_res->blocked),lock_res->blocked.next(i.e.dlm_lock.list_head again).....Signed-off-by joyce <[email protected]>--- fs/ocfs2/dlm/dlmlock.c | 1 + 1 file changed, 1 insertion(+)fs/ocfs2/dlm/dlmlock.c +1
-0@@ -178,6 +178,7 @@ static enum dlm_status dlmlock_master(struct dlm_ctxt *dlm, lock->ml.node); } }else { + status =DLM_NORMAL ;dlm_lock_get (lock);list_add_tail (&lock->list, &res->blocked); kick_thread =1 ;
PATCH 1/1 ocfs2: dlmlock_master should return DLM_NORMAL after adding lock to blocked list
In reply to Xue jiufeiHi Jiufei,
Quoted 27 lines · Xue jiufei
Function
dlmlock_master()returns DLM_RECOVERING/DLM_MIGRATING/DLM_FORWARafter adding lock to blocked list if lockres has the state DLM_LOCK_RES_RECOVERING/DLM_LOCK_RES_MIGRATING/DLM_LOCK_RES_IN_PROGRESS. so it will retry indlmlock(). And this may causedlm_threadfall into an infinite loopThread1
dlm_thread
callsdlm_lock->dlmlock_master,
if lockresA is in stateDLM_LOCK_RES_RECOVERING, calls__dlm_wait_on_lockres()and waits
until others threads clear this
state;If cannot grant this lock,
adding lock to blocked list,
and returnDLM_RECOVERING;Grant this lock and move it to grant list;
After a while, retry and
callslist_add_tail(), adding lock
to blocked list again.Granted and blocked list of this lockres will become the following conditions:
Quoted 7 lines
lock_res->granted.next = dlm_lock->list_head; lock_res->blocked.next = dlm_lock->list_head; dlm_lock->list_head.next = dlm_lock_resource->blocked;When
dlm_threadtraverses the granted list, it will fall into an endless loop, checking dlm_lock.list_head,dlm_lock->list_head.next(i.e.lock_res->blocked),lock_res->blocked.next(i.e.dlm_lock.list_head again).....
Thanks for your nice description of this problem and this fix looks good. Let's waiting for an ACK from either Sunil, Mark or Joel.
-Jeff
Quoted 18 lines
Signed-off-by joyce <[email protected]>--- fs/ocfs2/dlm/dlmlock.c | 1 + 1 file changed, 1 insertion(+)fs/ocfs2/dlm/dlmlock.c +1
-0@@ -178,6 +178,7 @@ static enum dlm_status dlmlock_master(struct dlm_ctxt *dlm, lock->ml.node); } }else { + status =DLM_NORMAL ;dlm_lock_get (lock);list_add_tail (&lock->list, &res->blocked); kick_thread =1 ;
PATCH 1/1 ocfs2: dlmlock_master should return DLM_NORMAL after adding lock to blocked list
Quoted 39 lines · On Sun, 23 Jun 2013 18:39:16 +0800 Jeff Liu <[email protected]> wrote:
Hi Jiufei,
Quoted 27 lines · Xue jiufei
Function
dlmlock_master()returns DLM_RECOVERING/DLM_MIGRATING/DLM_FORWARafter adding lock to blocked list if lockres has the state DLM_LOCK_RES_RECOVERING/DLM_LOCK_RES_MIGRATING/DLM_LOCK_RES_IN_PROGRESS. so it will retry indlmlock(). And this may causedlm_threadfall into an infinite loopThread1
dlm_thread
callsdlm_lock->dlmlock_master,
if lockresA is in stateDLM_LOCK_RES_RECOVERING, calls__dlm_wait_on_lockres()and waits
until others threads clear this
state;If cannot grant this lock,
adding lock to blocked list,
and returnDLM_RECOVERING;Grant this lock and move it to grant list;
After a while, retry and
callslist_add_tail(), adding lock
to blocked list again.Granted and blocked list of this lockres will become the following conditions:
Quoted 7 lines
lock_res->granted.next = dlm_lock->list_head; lock_res->blocked.next = dlm_lock->list_head; dlm_lock->list_head.next = dlm_lock_resource->blocked;When
dlm_threadtraverses the granted list, it will fall into an endless loop, checking dlm_lock.list_head,dlm_lock->list_head.next(i.e.lock_res->blocked),lock_res->blocked.next(i.e.dlm_lock.list_head again).....
Quoted 2 lines
Thanks for your nice description of this problem and this fix looks good. Let's waiting for an ACK from either Sunil, Mark or Joel.
Still waiting ;)
From: Xue jiufei <[email protected]>
Subject: ocfs2: dlmlock_master() should return DLM_NORMAL after adding lock to blocked list
dlmlock_master() returns DLM_RECOVERING/DLM_MIGRATING/ DLM_FORWAR after adding lock to blocked list if lockres has the state DLM_LOCK_RES_RECOVERING/DLM_LOCK_RES_MIGRATING/ DLM_LOCK_RES_IN_PROGRESS. so it will retry in dlmlock(). And this may cause dlm_thread fall into an infinite loop
Thread1 dlm_thread
calls dlm_lock->dlmlock_master,
if lockresA is in stateDLM_LOCK_RES_RECOVERING, calls__dlm_wait_on_lockres() and waits
until others threads clear this
state;
If cannot grant this lock,
adding lock to blocked list,
and return DLM_RECOVERING;
Grant this lock and move it to grant list;
After a while, retry and
calls list_add_tail(), adding lock
to blocked list again.
Granted and blocked list of this lockres will become the following conditions:
lock_res->granted.next = dlm_lock->list_head;
lock_res->blocked.next = dlm_lock->list_head;
dlm_lock->list_head.next = dlm_lock_resource->blocked;When dlm_thread traverses the granted list, it will fall into an endless loop, checking dlm_lock.list_head, dlm_lock->list_head.next (i.e.lock_res->blocked), lock_res->blocked.next(i.e.dlm_lock.list_head again) .....
---
fs/ocfs2/dlm/dlmlock.c | 1 + 1 file changed, 1 insertion(+)
fs/ocfs2/dlm/dlmlock.c renamed from fs/ocfs2/dlm/dlmlock.c~ocfs2-dlmlock_master-should-return-dlm_normal-after-adding-lock-to-blocked-list +1 -0
@@ -178,6 +178,7 @@ static enum dlm_status dlmlock_master(st lock->ml.node); } }else { + status =DLM_NORMAL ;dlm_lock_get (lock);list_add_tail (&lock->list, &res->blocked); kick_thread =1 ;
_
PATCH 1/1 ocfs2: dlmlock_master should return DLM_NORMAL after adding lock to blocked list
Quoted 117 lines · Andrew Morton
Quoted 39 lines · On Sun, 23 Jun 2013 18:39:16 +0800 Jeff Liu <[email protected]> wrote:
Hi Jiufei,
Quoted 27 lines · Xue jiufei
Function
dlmlock_master()returns DLM_RECOVERING/DLM_MIGRATING/DLM_FORWARafter adding lock to blocked list if lockres has the state DLM_LOCK_RES_RECOVERING/DLM_LOCK_RES_MIGRATING/DLM_LOCK_RES_IN_PROGRESS. so it will retry indlmlock(). And this may causedlm_threadfall into an infinite loopThread1
dlm_thread
callsdlm_lock->dlmlock_master,
if lockresA is in stateDLM_LOCK_RES_RECOVERING, calls__dlm_wait_on_lockres()and waits
until others threads clear this
state;If cannot grant this lock,
adding lock to blocked list,
and returnDLM_RECOVERING;Grant this lock and move it to grant list;
After a while, retry and
callslist_add_tail(), adding lock
to blocked list again.Granted and blocked list of this lockres will become the following conditions:
Quoted 7 lines
lock_res->granted.next = dlm_lock->list_head; lock_res->blocked.next = dlm_lock->list_head; dlm_lock->list_head.next = dlm_lock_resource->blocked;When
dlm_threadtraverses the granted list, it will fall into an endless loop, checking dlm_lock.list_head,dlm_lock->list_head.next(i.e.lock_res->blocked),lock_res->blocked.next(i.e.dlm_lock.list_head again).....Quoted 2 lines
Thanks for your nice description of this problem and this fix looks good. Let's waiting for an ACK from either Sunil, Mark or Joel.
Still waiting ;)
From: Xue jiufei <[email protected]>
Subject: ocfs2:dlmlock_master()should returnDLM_NORMALafter adding lock to blocked list
dlmlock_master()returns DLM_RECOVERING/DLM_MIGRATING/DLM_FORWARafter adding lock to blocked list if lockres has the state DLM_LOCK_RES_RECOVERING/DLM_LOCK_RES_MIGRATING/DLM_LOCK_RES_IN_PROGRESS. so it will retry indlmlock(). And this may causedlm_threadfall into an infinite loopThread1
dlm_thread
callsdlm_lock->dlmlock_master,
if lockresA is in stateDLM_LOCK_RES_RECOVERING, calls__dlm_wait_on_lockres()and waits
until others threads clear this
state;If cannot grant this lock,
adding lock to blocked list,
and returnDLM_RECOVERING;Grant this lock and move it to grant list;
After a while, retry and
callslist_add_tail(), adding lock
to blocked list again.Granted and blocked list of this lockres will become the following conditions:
lock_res->granted.next = dlm_lock->list_head; lock_res->blocked.next = dlm_lock->list_head; dlm_lock->list_head.next = dlm_lock_resource->blocked;When
dlm_threadtraverses the granted list, it will fall into an endless loop, checking dlm_lock.list_head,dlm_lock->list_head.next(i.e.lock_res->blocked),lock_res->blocked.next(i.e.dlm_lock.list_head again).....Signed-off-by joyce <[email protected]>Reviewed-by jensen <[email protected]>Cc Jeff Liu <[email protected]>Cc Sunil Mushran <[email protected]>Cc Mark Fasheh <[email protected]>Cc Joel Becker <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
fs/ocfs2/dlm/dlmlock.c | 1 + 1 file changed, 1 insertion(+)diff -puN
fs/ocfs2/dlm/dlmlock.c~ocfs2-dlmlock_master-should-return-dlm_normal-after-adding-lock-to-blocked-listfs/ocfs2/dlm/dlmlock.c
---
a/fs/ocfs2/dlm/dlmlock.c~ocfs2-dlmlock_master-should-return-dlm_normal-after-adding-lock-to-blocked-list +++a/fs/ocfs2/dlm/dlmlock.cfs/ocfs2/dlm/dlmlock.c renamed from fs/ocfs2/dlm/dlmlock.c~ocfs2-dlmlock_master-should-return-dlm_normal-after-adding-lock-to-blocked-list +1
-0@@ -178,6 +178,7 @@ static enum dlm_status dlmlock_master(st lock->ml.node); } }else { + status =DLM_NORMAL ;dlm_lock_get (lock);list_add_tail (&lock->list, &res->blocked); kick_thread =1 ;_
Quoted 5 lines
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20130628/45bdce64/attachment.html