Skip to contentSkip to conversation

ocfs2: fix BUG_ON(res->migration_pending) in dlm_mark_lockres_migrating

PATCH New Xue jiufei 1 participant 1 message Dec 21, 2012 OCFS2

lore
Share & tools
lore

Xue jiufei

author
#0 lore raw

PATCH 1/1 ocfs2: fix BUG_ON(res->migration_pending) in dlm_mark_lockres_migrating

When dlm_lockres_release_ast() returns without clearing
res->migration_pending, dlm_mark_lockres_migrating() exits abnormally with res->migration_pending setting to 1. When reentering dlm_mark_lockres_migrating(), it will trigger the BUG_ON with res->migration_pending. Clearing migration_pending when target is down can resolve this issue.

---
 fs/ocfs2/dlm/dlmmaster.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
fs/ocfs2/dlm/dlmmaster.c +3 -0
index 005261c..c491f97 100644
@@ -2751,6 +2751,9 @@ again:
 	if (!test_bit(target, dlm->domain_map)) {
 		mlog(ML_ERROR, "aha. migration target %u just went down\n",
 		     target);
+		spin_lock(&res->spinlock);
+		res->migration_pending = 0;
+		spin_unlock(&res->spinlock);
 		ret = -EHOSTDOWN;
 	}
 	spin_unlock(&dlm->spinlock);
Signature · 1 line
1.7.8.6