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);
#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
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;
#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
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);