windows-callback-lock-order-20080827

LICENSE MIT

do not hold cm_server_t mutex when calling cm_FindVolumeByID because
the cm_volume_t lock must be obtained ahead of the cm_server_t mutex
This commit is contained in:
Jeffrey Altman 2008-08-27 23:01:51 +00:00
parent c50857b05e
commit 0affa4b86a

View File

@ -1963,13 +1963,14 @@ cm_GiveUpAllCallbacks(cm_server_t *tsp, afs_int32 markDown)
cm_req_t req; cm_req_t req;
cm_InitReq(&req); cm_InitReq(&req);
lock_ReleaseMutex(&tsp->mx);
code = cm_FindVolumeByID(tsp->cellp, tsrvp->ids[i], cm_rootUserp, code = cm_FindVolumeByID(tsp->cellp, tsrvp->ids[i], cm_rootUserp,
&req, CM_GETVOL_FLAG_NO_LRU_UPDATE | CM_GETVOL_FLAG_NO_RESET, &volp); &req, CM_GETVOL_FLAG_NO_LRU_UPDATE | CM_GETVOL_FLAG_NO_RESET, &volp);
lock_ObtainMutex(&tsp->mx);
if (code == 0) { if (code == 0) {
cm_UpdateVolumeStatus(volp, tsrvp->ids[i]); cm_UpdateVolumeStatus(volp, tsrvp->ids[i]);
cm_PutVolume(volp); cm_PutVolume(volp);
} }
} }
} }
} }