diff --git a/src/WINNT/afsd/cm_cell.c b/src/WINNT/afsd/cm_cell.c index 6552d324e1..bf06465e77 100644 --- a/src/WINNT/afsd/cm_cell.c +++ b/src/WINNT/afsd/cm_cell.c @@ -69,7 +69,7 @@ long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *hostnamep) * and check to make sure we have a valid set of volume servers * this function must be called with a Write Lock on cm_cellLock */ -static cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags) +cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags) { long code = 0; cm_cell_rock_t rock; @@ -403,6 +403,7 @@ void cm_InitCell(int newFile, long maxCells) for (cellp = cm_data.allCellsp; cellp; cellp=cellp->allNextp) { lock_InitializeMutex(&cellp->mx, "cm_cell_t mutex"); cellp->vlServersp = NULL; + cellp->flags |= CM_CELLFLAG_VLSERVER_INVALID; } } diff --git a/src/WINNT/afsd/cm_cell.h b/src/WINNT/afsd/cm_cell.h index 2471ea2654..659843a25a 100644 --- a/src/WINNT/afsd/cm_cell.h +++ b/src/WINNT/afsd/cm_cell.h @@ -72,4 +72,6 @@ extern void cm_AddCellToIDHashTable(cm_cell_t * cellp); extern long cm_AddCellProc(void *rockp, struct sockaddr_in *addrp, char *namep); +extern cm_cell_t *cm_UpdateCell(cm_cell_t * cp, afs_uint32 flags); + #endif /* __CELL_H_ENV_ */ diff --git a/src/WINNT/afsd/cm_volume.c b/src/WINNT/afsd/cm_volume.c index 615b5a40f2..9d396d8fda 100644 --- a/src/WINNT/afsd/cm_volume.c +++ b/src/WINNT/afsd/cm_volume.c @@ -209,6 +209,9 @@ long cm_UpdateVolume(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *reqp, } else #endif { + if (cellp->flags & CM_CELLFLAG_VLSERVER_INVALID) + cm_UpdateCell(cellp, 0); + /* now we have volume structure locked and held; make RPC to fill it */ osi_Log2(afsd_logp, "CALL VL_GetEntryByName{UNO} name %s:%s", volp->cellp->name, volp->namep); do { @@ -1009,7 +1012,15 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID) lock_ObtainMutex(&volp->mx); + if (volp->flags & CM_VOLUMEFLAG_RESET) { + cm_InitReq(&req); + code = cm_UpdateVolume(volp->cellp, cm_rootUserp, &req, volp); + if (code == 0) + volp->flags &= ~CM_VOLUMEFLAG_RESET; + } + if (volp->rw.ID != 0 && (!volID || volID == volp->rw.ID) && + volp->rw.serversp && (volp->rw.state == vl_busy || volp->rw.state == vl_offline || volp->rw.state == vl_unknown)) { cm_InitReq(&req); @@ -1045,6 +1056,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID) } if (volp->ro.ID != 0 && (!volID || volID == volp->ro.ID) && + volp->ro.serversp && (volp->ro.state == vl_busy || volp->ro.state == vl_offline || volp->ro.state == vl_unknown)) { cm_InitReq(&req); @@ -1080,6 +1092,7 @@ cm_CheckOfflineVolume(cm_volume_t *volp, afs_uint32 volID) } if (volp->bk.ID != 0 && (!volID || volID == volp->bk.ID) && + volp->bk.serversp && (volp->bk.state == vl_busy || volp->bk.state == vl_offline || volp->bk.state == vl_unknown)) { cm_InitReq(&req);