Skip to contentSkip to conversation

ocfs2 fixes

PATCH New Mark Fasheh 1 participant 1 message Mar 28, 2007 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2 fixes

Hi Linus,

These two fixes are for ocfs2 dlm regressions introduced during the
merge window.

Please pull from 'upstream-linus' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git upstream-linus

to receive the following updates:

 fs/ocfs2/dlm/dlmdomain.c |    8 ++-
 fs/ocfs2/dlm/dlmmaster.c |   99 ++++++++++++++++++++++++++++++-----------------
 fs/ocfs2/dlm/dlmthread.c |   10 ----
 3 files changed, 73 insertions(+), 44 deletions(-)

Sunil Mushran:
ocfs2_dlm: Fix lockres ref counting bug
ocfs2_dlm: Check for migrateable lockres in dlm_empty_lockres()

fs/ocfs2/dlm/dlmdomain.c +6 -2
index 6087c47..c558442 100644
@@ -138,8 +138,10 @@ static void dlm_unregister_domain_handle
 
 void __dlm_unhash_lockres(struct dlm_lock_resource *lockres)
 {
-	hlist_del_init(&lockres->hash_node);
-	dlm_lockres_put(lockres);
+	if (!hlist_unhashed(&lockres->hash_node)) {
+		hlist_del_init(&lockres->hash_node);
+		dlm_lockres_put(lockres);
+	}
 }
 
 void __dlm_insert_lockres(struct dlm_ctxt *dlm,
@@ -655,6 +657,8 @@ void dlm_unregister_domain(struct dlm_ct
 		dlm_kick_thread(dlm, NULL);
 
 		while (dlm_migrate_all_locks(dlm)) {
+			/* Give dlm_thread time to purge the lockres' */
+			msleep(500);
 			mlog(0, "%s: more migration to do\n", dlm->name);
 		}
 		dlm_mark_domain_leaving(dlm);
fs/ocfs2/dlm/dlmmaster.c +65 -34

139 lines not on this page · raw message

fs/ocfs2/dlm/dlmthread.c +2 -8
index 6421a8f..2b264c6 100644
@@ -256,20 +256,14 @@ static void dlm_run_purge_list(struct dl
 			break;
 		}
 
-		mlog(0, "removing lockres %.*s:%p from purgelist\n",
-		     lockres->lockname.len, lockres->lockname.name, lockres);
-		list_del_init(&lockres->purge);
-		dlm_lockres_put(lockres);
-		dlm->purge_count--;
+		dlm_lockres_get(lockres);
 
 		/* This may drop and reacquire the dlm spinlock if it
 		 * has to do migration. */
-		mlog(0, "calling dlm_purge_lockres!\n");
-		dlm_lockres_get(lockres);
 		if (dlm_purge_lockres(dlm, lockres))
 			BUG();
+
 		dlm_lockres_put(lockres);
-		mlog(0, "DONE calling dlm_purge_lockres!\n");
 
 		/* Avoid adding any scheduling latencies */
 		cond_resched_lock(&dlm->spinlock);