aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ocfs2/dlm/dlmmaster.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index cbf3abe24cdb..54e182a27caf 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -732,14 +732,21 @@ lookup:
732 if (tmpres) { 732 if (tmpres) {
733 int dropping_ref = 0; 733 int dropping_ref = 0;
734 734
735 spin_unlock(&dlm->spinlock);
736
735 spin_lock(&tmpres->spinlock); 737 spin_lock(&tmpres->spinlock);
738 /* We wait for the other thread that is mastering the resource */
739 if (tmpres->owner == DLM_LOCK_RES_OWNER_UNKNOWN) {
740 __dlm_wait_on_lockres(tmpres);
741 BUG_ON(tmpres->owner == DLM_LOCK_RES_OWNER_UNKNOWN);
742 }
743
736 if (tmpres->owner == dlm->node_num) { 744 if (tmpres->owner == dlm->node_num) {
737 BUG_ON(tmpres->state & DLM_LOCK_RES_DROPPING_REF); 745 BUG_ON(tmpres->state & DLM_LOCK_RES_DROPPING_REF);
738 dlm_lockres_grab_inflight_ref(dlm, tmpres); 746 dlm_lockres_grab_inflight_ref(dlm, tmpres);
739 } else if (tmpres->state & DLM_LOCK_RES_DROPPING_REF) 747 } else if (tmpres->state & DLM_LOCK_RES_DROPPING_REF)
740 dropping_ref = 1; 748 dropping_ref = 1;
741 spin_unlock(&tmpres->spinlock); 749 spin_unlock(&tmpres->spinlock);
742 spin_unlock(&dlm->spinlock);
743 750
744 /* wait until done messaging the master, drop our ref to allow 751 /* wait until done messaging the master, drop our ref to allow
745 * the lockres to be purged, start over. */ 752 * the lockres to be purged, start over. */