int freelance = 0;
#endif
afs_uint32 volType;
+ time_t now;
lock_AssertWrite(&volp->rw);
* minutes and it did not exist, then avoid the RPC
* and return No Such Volume immediately.
*/
+ now = time(NULL);
if ((volp->flags & CM_VOLUMEFLAG_NOEXIST) &&
- volp->lastUpdateTime + 600 < time(0))
+ (now < volp->lastUpdateTime + 600))
{
return CM_ERROR_NOSUCHVOLUME;
}
volp->vol[BACKVOL].state = bkNewstate;
}
- volp->lastUpdateTime = time(0);
+ volp->lastUpdateTime = time(NULL);
if (code == 0)
volp->flags &= ~CM_VOLUMEFLAG_RESET;
for (volp = cm_data.volumeLRULastp;
volp && !daemon_ShutdownFlag && !powerStateSuspended;
volp=(cm_volume_t *) osi_QPrev(&volp->q)) {
- if (volp->qflags & CM_VOLUME_QFLAG_IN_HASH) {
+ /*
+ * Skip volume entries that did not exist last time
+ * the vldb was queried. For those entries wait until
+ * the next actual request is received for the volume
+ * before checking its state.
+ */
+ if ((volp->qflags & CM_VOLUME_QFLAG_IN_HASH) &&
+ !(volp->flags & CM_VOLUMEFLAG_NOEXIST)) {
InterlockedIncrement(&volp->refCount);
lock_ReleaseRead(&cm_volumeLock);
cm_CheckOfflineVolume(volp, 0);