From 6ec04e36328c79d597cf37d3e407a9f70ae67dae Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 13 Jun 2007 07:38:39 +0000 Subject: [PATCH] DEVEL15-windows-server-ping-deadlock-20070612 avoid deadlock in cm_ServerPing due to volume status update code (cherry picked from commit c74a23fc4043e28a138fe624b1aadf3af1ee8f6f) --- src/WINNT/afsd/cm_server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/WINNT/afsd/cm_server.c b/src/WINNT/afsd/cm_server.c index 7fedd97e8a..89f749518b 100644 --- a/src/WINNT/afsd/cm_server.c +++ b/src/WINNT/afsd/cm_server.c @@ -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; iids[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; iids[i] != 0) { @@ -177,6 +180,7 @@ cm_PingServer(cm_server_t *tsp) } } } + lock_ObtainMutex(&tsp->mx); } }