DEVEL15-windows-hold-server-mutex-for-vol-list-20071223

LICENSE MIT

When walking or modifying the cm_server_vols_t associated with a given
cm_server_t the mutex must be held.  Otherwise, races can occur.


(cherry picked from commit b0bae13aec9acb944d5d6a64c11df857ffc40eb3)
This commit is contained in:
Jeffrey Altman 2007-12-24 05:30:37 +00:00
parent 50bf917efd
commit efb0e9ebd8
2 changed files with 1 additions and 6 deletions

View File

@ -1905,8 +1905,6 @@ cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown)
tsp->downTime = osi_Time();
}
cm_ForceNewConnections(tsp);
lock_ReleaseMutex(&tsp->mx);
/* Now update the volume status */
for (tsrvp = tsp->vols; tsrvp; tsrvp = tsrvp->nextp) {
for (i=0; i<NUM_SERVER_VOLS; i++) {
@ -1924,6 +1922,7 @@ cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown)
}
}
}
lock_ReleaseMutex(&tsp->mx);
}
}
}

View File

@ -133,7 +133,6 @@ 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) {
@ -148,7 +147,6 @@ cm_PingServer(cm_server_t *tsp)
}
}
}
lock_ObtainMutex(&tsp->mx);
}
} else {
/* mark server as down */
@ -170,7 +168,6 @@ 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) {
@ -185,7 +182,6 @@ cm_PingServer(cm_server_t *tsp)
}
}
}
lock_ObtainMutex(&tsp->mx);
}
}