]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: [Inline]BulkStat VolSync not accurate?
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 21 Jun 2012 23:29:26 +0000 (19:29 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Tue, 3 Jul 2012 16:25:27 +0000 (09:25 -0700)
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>
src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/cm_callback.h
src/WINNT/afsd/cm_scache.c
src/WINNT/afsd/cm_scache.h
src/WINNT/afsd/cm_vnodeops.c

index fdcd9476709f2fe2309fc90428e6c5c1e39c8954..72ecaad8a2695bf2a6fd85ae55f9e089dca7eeef 100644 (file)
@@ -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);
index 089335bcdea906de2472ebf800a5d83ff1021b9c..e7096867cfede1cb56daaea41da42fda26fed8fc 100644 (file)
@@ -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
index b8034fa654f278004d1137cd0b74e9b461fc7125..08490f033343b9cb8b9effcda36c00445f170dcc 100644 (file)
@@ -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;
 
index c01dfc81dff411cb14bf5af62af1e3ad145656bc..3a4cd05619782d42f226f81fbcd64919676e6364 100644 (file)
@@ -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
index f7e4be1d7a3d013c96159fd3e1b7135a8b7ef4f4..cd9996935e63cf042294677a360aa7fea6a7aaec 100644 (file)
@@ -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);