mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
Windows: [Inline]BulkStat VolSync not accurate?
Instead of only recording the volume creation date when cm_readonlyVolumeVersioning is true, record the date whenever the RPC in use is not a RXAFS_[Inline]BulkStatus. This is tracked by the addition of flags for cm_MergeStatus and cm_EndCallBackGrantingCall which identify when the RPC was in fact a BulkStat variant. As a reminder, pre- 1.4.11 and 1.6.0 file servers do not properly set the VolSync structure when responding to BulkStat RPCs. At present, there is no method of identifying when it is safe to use them. When cm_readonlyVolumeVersioning is TRUE, it is assumed that the file servers are new enough to do the right thing. Change-Id: Ida9a30b07ea646a094e9753af9d79f36ab095a98 Reviewed-on: http://gerrit.openafs.org/7638 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com> Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
parent
ae25cf277c
commit
877053a8cd
@ -1742,7 +1742,10 @@ cm_EndCallbackGrantingCall(cm_scache_t *scp, cm_callbackRequest_t *cbrp,
|
||||
lock_ObtainWrite(&cm_scacheLock);
|
||||
volp->cbExpiresRO = scp->cbExpires;
|
||||
volp->cbIssuedRO = scp->cbIssued;
|
||||
volp->creationDateRO = volSyncp->spare1;
|
||||
if (cm_readonlyVolumeVersioning || !(flags & CM_CALLBACK_BULKSTAT))
|
||||
volp->creationDateRO = volSyncp->spare1;
|
||||
else
|
||||
volp->creationDateRO = 0;
|
||||
if (volp->cbServerpRO != scp->cbServerp) {
|
||||
if (volp->cbServerpRO)
|
||||
cm_PutServer(volp->cbServerpRO);
|
||||
|
@ -37,6 +37,7 @@ typedef struct cm_racingRevokes {
|
||||
#define CM_CALLBACK_MAINTAINCOUNT 1 /* don't decrement count of
|
||||
* callback-granting calls.
|
||||
*/
|
||||
#define CM_CALLBACK_BULKSTAT 2 /* volSync may not be trustworthy */
|
||||
|
||||
/* Combinations of change notification filters to make sure callback loss
|
||||
* gets noticed
|
||||
|
@ -1765,8 +1765,19 @@ void cm_MergeStatus(cm_scache_t *dscp,
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (cm_readonlyVolumeVersioning)
|
||||
/*
|
||||
* The first field of the volsync parameter is supposed to be the
|
||||
* volume creation date. Unfortunately, pre-OpenAFS 1.4.11 and 1.6.0
|
||||
* file servers do not populate the VolSync structure for BulkStat and
|
||||
* InlineBulkStat RPCs. As a result, the volume creation date is not
|
||||
* trustworthy when status is obtained via [Inline]BulkStatus RPCs.
|
||||
* If cm_readonlyVolumeVersioning is set, it is assumed that all file
|
||||
* servers populate the VolSync structure at all times.
|
||||
*/
|
||||
if (cm_readonlyVolumeVersioning || !(flags & CM_MERGEFLAG_BULKSTAT))
|
||||
scp->volumeCreationDate = volsyncp->spare1; /* volume creation date */
|
||||
else
|
||||
scp->volumeCreationDate = 0;
|
||||
|
||||
scp->serverModTime = statusp->ServerModTime;
|
||||
|
||||
|
@ -345,6 +345,7 @@ typedef struct cm_scache {
|
||||
#define CM_MERGEFLAG_STOREDATA 2 /* Merge due to storedata op */
|
||||
#define CM_MERGEFLAG_DIROP 4 /* Merge due to directory op */
|
||||
#define CM_MERGEFLAG_FETCHDATA 8 /* Merge due to fetchdata op */
|
||||
#define CM_MERGEFLAG_BULKSTAT 0x10 /* Merge due to bulkstat op */
|
||||
|
||||
/* hash define. Must not include the cell, since the callback revocation code
|
||||
* doesn't necessarily know the cell in the case of a multihomed server
|
||||
|
@ -2560,10 +2560,10 @@ cm_TryBulkStatRPC(cm_scache_t *dscp, cm_bulkStat_t *bbp, cm_user_t *userp, cm_re
|
||||
lostRace = cm_EndCallbackGrantingCall(scp, &cbReq,
|
||||
&bbp->callbacks[j],
|
||||
&volSync,
|
||||
CM_CALLBACK_MAINTAINCOUNT);
|
||||
CM_CALLBACK_MAINTAINCOUNT|CM_CALLBACK_BULKSTAT);
|
||||
InterlockedIncrement(&scp->activeRPCs);
|
||||
if (!lostRace)
|
||||
cm_MergeStatus(dscp, scp, &bbp->stats[j], &volSync, userp, reqp, 0);
|
||||
cm_MergeStatus(dscp, scp, &bbp->stats[j], &volSync, userp, reqp, CM_MERGEFLAG_BULKSTAT);
|
||||
lock_ReleaseWrite(&scp->rw);
|
||||
} else {
|
||||
lock_ReleaseRead(&scp->rw);
|
||||
|
Loading…
Reference in New Issue
Block a user