Windows: disable readonly volume versioning due to file server bug

Change I17e3980184ec68e38c5186e1c9637ac6e38451fe corrects a file
server bug that results in invalid volume sync data being sent
to clients during bulk status rpcs.  Unless this is fixed in the
file servers it is not safe to use the volume versioning functionality.

This patchset disables the functionality by default and permits
it to be turned on via a registry value.  If the client is deployed
in an environment in which all of the file servers have been fixed,
then it will be safe to turn this feature on.

LICENSE MIT

Change-Id: I0db38ffc9cdeb90db20b92adca9a42a06fed2e2f
Reviewed-on: http://gerrit.openafs.org/859
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Jeffrey Altman 2009-11-19 18:53:56 -05:00 committed by Jeffrey Altman
parent 072d69ac27
commit f716962ab4
4 changed files with 15 additions and 2 deletions

View File

@ -111,6 +111,7 @@ extern int cm_fakeGettingCallback; // 1 if currently updating the fake root.af
extern int cm_dnsEnabled;
extern int cm_freelanceEnabled;
extern int cm_readonlyVolumeVersioning;
extern long rx_mtu;

View File

@ -68,6 +68,7 @@ DWORD cm_mountRootLen;
clientchar_t cm_mountRootC[1024];
DWORD cm_mountRootCLen;
int cm_readonlyVolumeVersioning = 0;
int cm_logChunkSize;
int cm_chunkSize;
@ -1238,6 +1239,14 @@ afsd_InitCM(char **reasonP)
}
afsi_log("CM PerFileAccessCheck is %d", cm_accessPerFileCheck);
dummyLen = sizeof(DWORD);
code = RegQueryValueEx(parmKey, "ReadOnlyVolumeVersioning", NULL, NULL,
(BYTE *) &dwValue, &dummyLen);
if (code == ERROR_SUCCESS) {
cm_readonlyVolumeVersioning = (unsigned short) dwValue;
}
afsi_log("CM ReadOnlyVolumeVersioning is %u", cm_readonlyVolumeVersioning);
RegCloseKey (parmKey);
cacheBlocks = ((afs_uint64)cacheSize * 1024) / blockSize;

View File

@ -1576,7 +1576,8 @@ int cm_HaveCallback(cm_scache_t *scp)
return 0;
}
#endif
if (scp->flags & CM_SCACHEFLAG_PURERO) {
if (cm_readonlyVolumeVersioning &&
(scp->flags & CM_SCACHEFLAG_PURERO)) {
cm_volume_t *volp = cm_GetVolumeByFID(&scp->fid);
if (volp) {
int haveCB = 0;

View File

@ -1635,7 +1635,8 @@ void cm_MergeStatus(cm_scache_t *dscp,
goto done;
}
scp->volumeCreationDate = volsyncp->spare1; /* volume creation date */
if (cm_readonlyVolumeVersioning)
scp->volumeCreationDate = volsyncp->spare1; /* volume creation date */
scp->serverModTime = statusp->ServerModTime;
@ -1805,6 +1806,7 @@ void cm_DiscardSCache(cm_scache_t *scp)
scp->cbServerp = NULL;
}
scp->cbExpires = 0;
scp->volumeCreationDate = 0;
scp->flags &= ~(CM_SCACHEFLAG_CALLBACK | CM_SCACHEFLAG_LOCAL);
cm_dnlcPurgedp(scp);
cm_dnlcPurgevp(scp);