ocfs2/dlm: ocfs2 dlm umount skip migrating lockres
PATCH 1/1 ocfs2/dlm: ocfs2 dlm umount skip migrating lockres
umount thread could race with migrate handler thread receiving resource migration request from other node. When this happens, migrating thread could set this node as the master along with DLM_LOCK_RES_MIGRATING flag. umount thread should skip migrating this newly owned lockres until DLM_LOCK_RES_MIGRATING flag is unset by migrate handler thread. umount thread will ultimately migrate this lockres during another pass of the lockres hash list.
--- fs/ocfs2/dlm/dlmmaster.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
fs/ocfs2/dlm/dlmmaster.c +4 -0
@@ -2360,6 +2360,10 @@ static int dlm_is_lockres_migrateable(struct dlm_ctxt *dlm,if (res->owner != dlm->node_num)return 0 ; +if (res->state &DLM_LOCK_RES_MIGRATING ) { +return 0 ; + } +for (idx =DLM_GRANTED_LIST ; idx <=DLM_BLOCKED_LIST ; idx++) { queue =dlm_list_idx_to_ptr (res, idx);list_for_each_entry (lock, queue, list) {
Signature · 1 line
1.7.1
PATCH 1/1 ocfs2/dlm: ocfs2 dlm umount skip migrating lockres
Quoted 20 lines · Tariq Saeed
umount thread could race with migrate handler thread receiving resource migration request from other node. When this happens, migrating thread could set this node as the master along with
DLM_LOCK_RES_MIGRATINGflag. umount thread should skip migrating this newly owned lockres untilDLM_LOCK_RES_MIGRATINGflag is unset by migrate handler thread. umount thread will ultimately migrate this lockres during another pass of the lockres hash list.Signed-off-by Tariq Saeed <[email protected]>Signed-off-by Srinivas Eeda <[email protected]>--- fs/ocfs2/dlm/dlmmaster.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)fs/ocfs2/dlm/dlmmaster.c +0
-0
fs/ocfs2/dlm/dlmmaster.c static int dlm_is_lockres_migrateable(struct dlm_ctxt *dlm, · line 2369
Quoted 10 lines
fs/ocfs2/dlm/dlmmaster.c +4
-0@@ -2360,6 +2360,10 @@ static int dlm_is_lockres_migrateable(struct dlm_ctxt *dlm,if (res->owner != dlm->node_num)return 0 ; +if (res->state &DLM_LOCK_RES_MIGRATING ) { +return 0 ; + } +for (idx =DLM_GRANTED_LIST ; idx <=DLM_BLOCKED_LIST ; idx++) { queue =dlm_list_idx_to_ptr (res, idx);list_for_each_entry (lock, queue, list) {
This patch was sent before by Jiufei Xue on Aug 2012, which was titled as "ocfs2: delay migration when the lockres is in migration state". Please refer the below link for details:
https://oss.oracle.com/pipermail/ocfs2-devel/2012-August/008670.html
As I remembered, the patch was alerady acked by Sunil and Joel, and then it was in ocfs2.git.
I am not sure why it wasn't merged to mainline.
PATCH 1/1 ocfs2/dlm: ocfs2 dlm umount skip migrating lockres
Joseph,
thanks for pointing it out.
Andrew,
can you please pull the following patch acked by Sunil and Joel
https://oss.oracle.com/pipermail/ocfs2-devel/2012-August/008670.html
Thanks,
--Srini
Quoted 46 lines · Joseph Qi
Quoted 20 lines · Tariq Saeed
umount thread could race with migrate handler thread receiving resource migration request from other node. When this happens, migrating thread could set this node as the master along with
DLM_LOCK_RES_MIGRATINGflag. umount thread should skip migrating this newly owned lockres untilDLM_LOCK_RES_MIGRATINGflag is unset by migrate handler thread. umount thread will ultimately migrate this lockres during another pass of the lockres hash list.Signed-off-by Tariq Saeed <[email protected]>Signed-off-by Srinivas Eeda <[email protected]>--- fs/ocfs2/dlm/dlmmaster.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)fs/ocfs2/dlm/dlmmaster.c +0
-0fs/ocfs2/dlm/dlmmaster.c static int dlm_is_lockres_migrateable(struct dlm_ctxt *dlm, · line 2369
Quoted 10 lines
fs/ocfs2/dlm/dlmmaster.c +4
-0@@ -2360,6 +2360,10 @@ static int dlm_is_lockres_migrateable(struct dlm_ctxt *dlm,if (res->owner != dlm->node_num)return 0 ; +if (res->state &DLM_LOCK_RES_MIGRATING ) { +return 0 ; + } +for (idx =DLM_GRANTED_LIST ; idx <=DLM_BLOCKED_LIST ; idx++) { queue =dlm_list_idx_to_ptr (res, idx);list_for_each_entry (lock, queue, list) {This patch was sent before by Jiufei Xue on Aug 2012, which was titled as "ocfs2: delay migration when the lockres is in migration state". Please refer the below link for details:
https://oss.oracle.com/pipermail/ocfs2-devel/2012-August/008670.htmlAs I remembered, the patch was alerady acked by Sunil and Joel, and then it was in ocfs2.git.
I am not sure why it wasn't merged to mainline._______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
PATCH 1/1 ocfs2/dlm: ocfs2 dlm umount skip migrating lockres
Quoted 4 lines · On Wed, 11 Sep 2013 21:00:20 -0700 Srinivas Eeda <[email protected]>…
Andrew,
can you please pull the following patch acked by Sunil and Joelhttps://oss.oracle.com/pipermail/ocfs2-devel/2012-August/008670.html
Yup. I just went through Joel's old linux-next tree and stole everything from it:
From: Joel Becker <[email protected]>
Subject: ocfs2: don't spam on -EDQUOT
From: Akinobu Mita <[email protected]>
Subject: ocfs2: use bitmap_weight()
From: Xue jiufei <[email protected]>
Subject: ocfs2: skip locks in the blocked list
From: Xue jiufei <[email protected]>
Subject: ocfs2: delay migration when the lockres is in migration state
From: Akinobu Mita <[email protected]>
Subject: ocfs2: use find_last_bit()
From: Junxiao Bi <[email protected]>
Subject: ocfs2: break useless while loop