ocfs2_dlm: Make dlmunlock() wait for migration to complete
authorKurt Hackel <kurt.hackel@oracle.com>
Fri, 5 Jan 2007 23:02:30 +0000 (15:02 -0800)
committerMark Fasheh <mark.fasheh@oracle.com>
Wed, 7 Feb 2007 20:01:49 +0000 (12:01 -0800)
dlmunlock() was not waiting for migration to complete before releasing locks
on locally mastered locks.

Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Sunil Mushran <Sunil.Mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/dlm/dlmrecovery.c
fs/ocfs2/dlm/dlmunlock.c

index d011a2a22742ae9b553bfd289c032236bf38684a..3057b65a4b8b2aaa486f5900f268d6cd1e06ed20 100644 (file)
@@ -1763,6 +1763,7 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm,
                                               "with cookie %u:%llu!\n",
                                               dlm_get_lock_cookie_node(c),
                                               dlm_get_lock_cookie_seq(c));
+                               __dlm_print_one_lock_resource(res);
                                BUG();
                        }
                        BUG_ON(lock->ml.node != ml->node);
index 37be4b2e0d4a8801982e97a8636f61abd1360d4e..3c8a250fcfec018b0017f2dcbac5d9479a448bc0 100644 (file)
@@ -147,6 +147,10 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
                goto leave;
        }
 
+       if (res->state & DLM_LOCK_RES_MIGRATING) {
+               status = DLM_MIGRATING;
+               goto leave;
+       }
 
        /* see above for what the spec says about
         * LKM_CANCEL and the lock queue state */