From: Jeffrey Altman Date: Mon, 11 Mar 2013 04:03:38 +0000 (-0400) Subject: Windows: Report actual volume creation time X-Git-Tag: openafs-stable-1_8_0pre1~1317 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=d64cd65a23996a7bb79cfecfdc0383de72601497;hp=002d97363f01e0099519c35fc2f5a2af4305267e Windows: Report actual volume creation time The cm_scache.volumeCreationDate is populated by any non-bulkstat callback issuing operation. If it is not set at the time the redirector requests volume information, force an RXAFS_FetchStatus and then use the resulting timestamp in the response. Change-Id: I8ab471767dd6525efc71deff073d54ae38f1f462 Reviewed-on: http://gerrit.openafs.org/9554 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsrdr/user/RDRFunction.c b/src/WINNT/afsrdr/user/RDRFunction.c index e58163f..3503154 100644 --- a/src/WINNT/afsrdr/user/RDRFunction.c +++ b/src/WINNT/afsrdr/user/RDRFunction.c @@ -5690,6 +5690,7 @@ RDR_GetVolumeInfo( IN cm_user_t *userp, cm_req_t req; DWORD status; FILETIME ft = {0x832cf000, 0x01abfcc4}; /* October 1, 1982 00:00:00 +0600 */ + afs_uint32 flags; char volName[32]="(unknown)"; char offLineMsg[256]="server temporarily inaccessible"; @@ -5773,8 +5774,6 @@ RDR_GetVolumeInfo( IN cm_user_t *userp, if ( pResultCB->CellLength ) pResultCB->CellLength--; } else { - memcpy(&pResultCB->VolumeCreationTime, &ft, sizeof(ft)); - volp = cm_GetVolumeByFID(&scp->fid); if (!volp) { code = CM_ERROR_NOSUCHVOLUME; @@ -5785,8 +5784,10 @@ RDR_GetVolumeInfo( IN cm_user_t *userp, if (volType == ROVOL || volType == BACKVOL) pResultCB->FileSystemAttributes |= FILE_READ_ONLY_VOLUME; - code = cm_SyncOp(scp, NULL, userp, &req, PRSFS_READ, - CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS); + flags = CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS; + if (scp->volumeCreationDate == 0) + flags |= CM_SCACHESYNC_FORCECB; + code = cm_SyncOp(scp, NULL, userp, &req, PRSFS_READ, flags); if (code == 0) { sync_done = 1; @@ -5810,6 +5811,10 @@ RDR_GetVolumeInfo( IN cm_user_t *userp, code = cm_MapRPCError(code, &req); } + if ( scp->volumeCreationDate ) + cm_LargeSearchTimeFromUnixTime(&ft, scp->volumeCreationDate); + memcpy(&pResultCB->VolumeCreationTime, &ft, sizeof(ft)); + if (code == 0) { if (volType == ROVOL || volType == BACKVOL) { pResultCB->TotalAllocationUnits.QuadPart = volStat.BlocksInUse;