aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmdomain.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/dlm/dlmdomain.c')
-rw-r--r--fs/ocfs2/dlm/dlmdomain.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
index 6087c4749fee..d836b98dd99a 100644
--- a/fs/ocfs2/dlm/dlmdomain.c
+++ b/fs/ocfs2/dlm/dlmdomain.c
@@ -138,8 +138,10 @@ static void dlm_unregister_domain_handlers(struct dlm_ctxt *dlm);
138 138
139void __dlm_unhash_lockres(struct dlm_lock_resource *lockres) 139void __dlm_unhash_lockres(struct dlm_lock_resource *lockres)
140{ 140{
141 hlist_del_init(&lockres->hash_node); 141 if (!hlist_unhashed(&lockres->hash_node)) {
142 dlm_lockres_put(lockres); 142 hlist_del_init(&lockres->hash_node);
143 dlm_lockres_put(lockres);
144 }
143} 145}
144 146
145void __dlm_insert_lockres(struct dlm_ctxt *dlm, 147void __dlm_insert_lockres(struct dlm_ctxt *dlm,
@@ -428,11 +430,10 @@ redo_bucket:
428 430
429 dlm_lockres_put(res); 431 dlm_lockres_put(res);
430 432
431 cond_resched_lock(&dlm->spinlock);
432
433 if (dropped) 433 if (dropped)
434 goto redo_bucket; 434 goto redo_bucket;
435 } 435 }
436 cond_resched_lock(&dlm->spinlock);
436 num += n; 437 num += n;
437 mlog(0, "%s: touched %d lockreses in bucket %d " 438 mlog(0, "%s: touched %d lockreses in bucket %d "
438 "(tot=%d)\n", dlm->name, n, i, num); 439 "(tot=%d)\n", dlm->name, n, i, num);
@@ -655,6 +656,8 @@ void dlm_unregister_domain(struct dlm_ctxt *dlm)
655 dlm_kick_thread(dlm, NULL); 656 dlm_kick_thread(dlm, NULL);
656 657
657 while (dlm_migrate_all_locks(dlm)) { 658 while (dlm_migrate_all_locks(dlm)) {
659 /* Give dlm_thread time to purge the lockres' */
660 msleep(500);
658 mlog(0, "%s: more migration to do\n", dlm->name); 661 mlog(0, "%s: more migration to do\n", dlm->name);
659 } 662 }
660 dlm_mark_domain_leaving(dlm); 663 dlm_mark_domain_leaving(dlm);
@@ -1031,7 +1034,7 @@ static int dlm_try_to_join_domain(struct dlm_ctxt *dlm)
1031{ 1034{
1032 int status = 0, tmpstat, node; 1035 int status = 0, tmpstat, node;
1033 struct domain_join_ctxt *ctxt; 1036 struct domain_join_ctxt *ctxt;
1034 enum dlm_query_join_response response; 1037 enum dlm_query_join_response response = JOIN_DISALLOW;
1035 1038
1036 mlog_entry("%p", dlm); 1039 mlog_entry("%p", dlm);
1037 1040