From f2bff0e675a2ca0b583264d59d288c62636a06b8 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 12 Nov 2007 03:24:59 +0000 Subject: [PATCH] windows-readonly-volume-callbacks-20071111 disable the option by default. require the daemonCheckVolCBInterval registry value be set in order to activate it. do not renew .readonly volumes whose callbacks are less than 30 minutes old. --- src/WINNT/afsd/cm_daemon.c | 8 +++++--- src/WINNT/afsd/cm_volume.c | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/WINNT/afsd/cm_daemon.c b/src/WINNT/afsd/cm_daemon.c index 5e47a7f323..0469c8db50 100644 --- a/src/WINNT/afsd/cm_daemon.c +++ b/src/WINNT/afsd/cm_daemon.c @@ -30,7 +30,7 @@ long cm_daemonCheckDownInterval = 180; long cm_daemonCheckUpInterval = 240; long cm_daemonCheckVolInterval = 3600; long cm_daemonCheckCBInterval = 60; -long cm_daemonCheckVolCBInterval = 1800; +long cm_daemonCheckVolCBInterval = 0; long cm_daemonCheckLockInterval = 60; long cm_daemonTokenCheckInterval = 180; long cm_daemonCheckOfflineVolInterval = 600; @@ -347,7 +347,8 @@ void cm_Daemon(long parm) now = osi_Time(); lastVolCheck = now - cm_daemonCheckVolInterval/2 + (rand() % cm_daemonCheckVolInterval); lastCBExpirationCheck = now - cm_daemonCheckCBInterval/2 + (rand() % cm_daemonCheckCBInterval); - lastVolCBRenewalCheck = now - cm_daemonCheckVolCBInterval/2 + (rand() % cm_daemonCheckVolCBInterval); + if (cm_daemonCheckVolCBInterval) + lastVolCBRenewalCheck = now - cm_daemonCheckVolCBInterval/2 + (rand() % cm_daemonCheckVolCBInterval); lastLockCheck = now - cm_daemonCheckLockInterval/2 + (rand() % cm_daemonCheckLockInterval); lastDownServerCheck = now - cm_daemonCheckDownInterval/2 + (rand() % cm_daemonCheckDownInterval); lastUpServerCheck = now - cm_daemonCheckUpInterval/2 + (rand() % cm_daemonCheckUpInterval); @@ -406,7 +407,8 @@ void cm_Daemon(long parm) now = osi_Time(); } - if (now > lastVolCBRenewalCheck + cm_daemonCheckVolCBInterval) { + if (cm_daemonCheckVolCBInterval && + now > lastVolCBRenewalCheck + cm_daemonCheckVolCBInterval) { lastVolCBRenewalCheck = now; cm_VolumeRenewROCallbacks(); now = osi_Time(); diff --git a/src/WINNT/afsd/cm_volume.c b/src/WINNT/afsd/cm_volume.c index e2d9d62ba7..326b6ef7d3 100644 --- a/src/WINNT/afsd/cm_volume.c +++ b/src/WINNT/afsd/cm_volume.c @@ -1496,16 +1496,18 @@ enum volstatus cm_GetVolumeStatus(cm_volume_t *volp, afs_uint32 volID) } } - +/* Renew .readonly volume callbacks that are more than + * 30 minutes old. (A volume callback is issued for 2 hours.) + */ void cm_VolumeRenewROCallbacks(void) { cm_volume_t * volp; - + time_t minexp = time(NULL) + 90 * 60; lock_ObtainRead(&cm_volumeLock); for (volp = cm_data.allVolumesp; volp; volp=volp->allNextp) { - if ( volp->cbExpiresRO > 0) { + if ( volp->cbExpiresRO > 0 && volp->cbExpiresRO < minexp) { cm_req_t req; cm_fid_t fid; cm_scache_t * scp;