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>
This commit is contained in:
parent
de46c33745
commit
756a1501dd
1 changed files with 2 additions and 0 deletions
|
@ -611,6 +611,7 @@ static int dlm_remaster_locks(struct dlm_ctxt *dlm, u8 dead_node)
|
||||||
}
|
}
|
||||||
} while (status != 0);
|
} while (status != 0);
|
||||||
|
|
||||||
|
spin_lock(&dlm_reco_state_lock);
|
||||||
switch (ndata->state) {
|
switch (ndata->state) {
|
||||||
case DLM_RECO_NODE_DATA_INIT:
|
case DLM_RECO_NODE_DATA_INIT:
|
||||||
case DLM_RECO_NODE_DATA_FINALIZE_SENT:
|
case DLM_RECO_NODE_DATA_FINALIZE_SENT:
|
||||||
|
@ -641,6 +642,7 @@ static int dlm_remaster_locks(struct dlm_ctxt *dlm, u8 dead_node)
|
||||||
ndata->node_num, dead_node);
|
ndata->node_num, dead_node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
spin_unlock(&dlm_reco_state_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
mlog(0, "done requesting all lock info\n");
|
mlog(0, "done requesting all lock info\n");
|
||||||
|
|
Loading…
Add table
Reference in a new issue