aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSrinivas Eeda <srinivas.eeda@oracle.com>2007-04-17 16:26:33 -0400
committerMark Fasheh <mark.fasheh@oracle.com>2007-04-26 16:33:02 -0400
commit756a1501ddbbe73098aa031939460930f6edc9cd (patch)
tree571202550a811b937277e227b27c26a0fcdf8b7c /fs
parentde46c33745f5e2ad594c72f2cf5f490861b16ce1 (diff)
ocfs2_dlm: fix race in dlm_remaster_locks
There is a possibility that dlm_remaster_locks could overwride node->state with DLM_RECO_NODE_DATA_REQUESTED after dlm_reco_data_done_handler sets the node->state to DLM_RECO_NODE_DATA_DONE. This could lead to recovery getting stuck and requires a cluster reboot. Synchronize with dlm_reco_state_lock spinlock. Signed-off-by: Srinivas Eeda <srinivas.eeda@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/dlm/dlmrecovery.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index 6d4a83d50152..c1807a42c49f 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -611,6 +611,7 @@ static int dlm_remaster_locks(struct dlm_ctxt *dlm, u8 dead_node)
611 } 611 }
612 } while (status != 0); 612 } while (status != 0);
613 613
614 spin_lock(&dlm_reco_state_lock);
614 switch (ndata->state) { 615 switch (ndata->state) {
615 case DLM_RECO_NODE_DATA_INIT: 616 case DLM_RECO_NODE_DATA_INIT:
616 case DLM_RECO_NODE_DATA_FINALIZE_SENT: 617 case DLM_RECO_NODE_DATA_FINALIZE_SENT:
@@ -641,6 +642,7 @@ static int dlm_remaster_locks(struct dlm_ctxt *dlm, u8 dead_node)
641 ndata->node_num, dead_node); 642 ndata->node_num, dead_node);
642 break; 643 break;
643 } 644 }
645 spin_unlock(&dlm_reco_state_lock);
644 } 646 }
645 647
646 mlog(0, "done requesting all lock info\n"); 648 mlog(0, "done requesting all lock info\n");