DEVEL15-windows-server-ping-deadlock-20070612

avoid deadlock in cm_ServerPing due to volume status update code


(cherry picked from commit c74a23fc40)
This commit is contained in:
Jeffrey Altman 2007-06-13 07:38:39 +00:00
parent 6da9229bb4
commit 6ec04e3632

View File

@ -131,6 +131,7 @@ cm_PingServer(cm_server_t *tsp)
cm_volume_t * volp;
int i;
lock_ReleaseMutex(&tsp->mx);
for (tsrvp = tsp->vols; tsrvp; tsrvp = tsrvp->nextp) {
for (i=0; i<NUM_SERVER_VOLS; i++) {
if (tsrvp->ids[i] != 0) {
@ -145,6 +146,7 @@ cm_PingServer(cm_server_t *tsp)
}
}
}
lock_ObtainMutex(&tsp->mx);
}
} else {
/* mark server as down */
@ -163,6 +165,7 @@ cm_PingServer(cm_server_t *tsp)
cm_volume_t * volp;
int i;
lock_ReleaseMutex(&tsp->mx);
for (tsrvp = tsp->vols; tsrvp; tsrvp = tsrvp->nextp) {
for (i=0; i<NUM_SERVER_VOLS; i++) {
if (tsrvp->ids[i] != 0) {
@ -177,6 +180,7 @@ cm_PingServer(cm_server_t *tsp)
}
}
}
lock_ObtainMutex(&tsp->mx);
}
}