Skip to contentSkip to conversation

ocfs2: delay migration when the lockres is in migration state

PATCH New Xue jiufei 3 participants 3 messages Aug 14, 2012 – Aug 15, 2012 OCFS2

lore
Share & tools
lore

Xue jiufei

author
#0 lore raw

PATCH 1/1 ocfs2: delay migration when the lockres is in migration state

We trigger a bug in __dlm_lockres_reserve_ast() when we parallel umount 4 nodes. The situation is as follows:
1) Node A migrate all lockres it owned(eg. lockres A) to other nodes say node B when it umounts.
2) Receiving MIG_LOCKRES message from A, Node B masters the lockres A with DLM_LOCK_RES_MIGRATING state set.
3) Then we umount ocfs2 on node B. It also should migrate lockres A to another node, say node C. But now, DLM_LOCK_RES_MIGRATING state
of lockers A is not cleared. Node B triggered the BUG on lockres with state DLM_LOCK_RES_MIGRATING.

---
 fs/ocfs2/dlm/dlmmaster.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/ocfs2/dlm/dlmmaster.c +4 -0
index 005261c..6c35406 100644
@@ -2357,6 +2357,10 @@ static int dlm_is_lockres_migrateable(struct dlm_ctxt *dlm,
 
 	assert_spin_locked(&res->spinlock);
 
+	/* delay migration when the lockres is in MIGRATING state */
+	if (res->state & DLM_LOCK_RES_MIGRATING)
+		return 0;
+
 	if (res->owner != dlm->node_num)
 		return 0;
 

-- 1.7.9.7

#1 lore raw

PATCH 1/1 ocfs2: delay migration when the lockres is in migration state

Quoted 34 lines · Xue jiufei

We trigger a bug in __dlm_lockres_reserve_ast() when we parallel umount
4 nodes. The situation is as follows:
1) Node A migrate all lockres it owned(eg. lockres A) to other nodes say
node B when it umounts.
2) Receiving MIG_LOCKRES message from A, Node B masters the lockres A
with DLM_LOCK_RES_MIGRATING state set.
3) Then we umount ocfs2 on node B. It also should migrate lockres A to
another node, say node C. But now, DLM_LOCK_RES_MIGRATING state of lockers A is not cleared. Node B triggered the BUG on lockres with state DLM_LOCK_RES_MIGRATING.

---
 fs/ocfs2/dlm/dlmmaster.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/ocfs2/dlm/dlmmaster.c +4 -1
index 005261c..6c35406 100644
@@ -2357,6 +2357,10 @@ static int dlm_is_lockres_migrateable(struct
 dlm_ctxt *dlm,
 
        assert_spin_locked(&res->spinlock);
 
+       /* delay migration when the lockres is in MIGRATING state */
+       if (res->state & DLM_LOCK_RES_MIGRATING)
+               return 0;
+
        if (res->owner != dlm->node_num)
                return 0;
 
-- 1.7.9.7
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/20120814/b2c851d5/attachment.html

maintainer
#2 lore raw

PATCH 1/1 ocfs2: delay migration when the lockres is in migration state

In reply to Xue jiufei
Quoted 7 lines · Xue jiufei

We trigger a bug in __dlm_lockres_reserve_ast() when we parallel umount 4 nodes. The situation is as follows:
1) Node A migrate all lockres it owned(eg. lockres A) to other nodes say node B when it umounts.
2) Receiving MIG_LOCKRES message from A, Node B masters the lockres A with DLM_LOCK_RES_MIGRATING state set.
3) Then we umount ocfs2 on node B. It also should migrate lockres A to another node, say node C. But now, DLM_LOCK_RES_MIGRATING state
of lockers A is not cleared. Node B triggered the BUG on lockres with state DLM_LOCK_RES_MIGRATING.

This patch is now part of the fixes branch of ocfs2.git.

Joel

Quoted 20 lines
---
 fs/ocfs2/dlm/dlmmaster.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/ocfs2/dlm/dlmmaster.c +4 -1
index 005261c..6c35406 100644
@@ -2357,6 +2357,10 @@ static int dlm_is_lockres_migrateable(struct dlm_ctxt *dlm,
 
 	assert_spin_locked(&res->spinlock);
 
+	/* delay migration when the lockres is in MIGRATING state */
+	if (res->state & DLM_LOCK_RES_MIGRATING)
+		return 0;
+
 	if (res->owner != dlm->node_num)
 		return 0;
 
-- 1.7.9.7 
Signature · 6 lines
Life's Little Instruction Book #139

	"Never deprive someone of hope; it might be all they have."

			http://www.jlbec.org/
			jlbec at evilplan.org