Windows: dir buffers out of date - mark them as such
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 4 Jan 2012 02:10:32 +0000 (21:10 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 11 Jan 2012 03:53:19 +0000 (19:53 -0800)
if cm_CheckForSingleDirChange() fails, mark the cm_scache_t
bufDataVersionLow as the current data version so that old directory
buffers are discarded.

Change-Id: I8d587a024027e74e66190fdc993564b640993b4c
Reviewed-on: http://gerrit.openafs.org/6498
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsd/cm_dir.c

index dae870f..86744cc 100644 (file)
@@ -1169,14 +1169,23 @@ cm_CheckDirOpForSingleChange(cm_dirOp_t * op)
     code = cm_DirCheckStatus(op, 1);
 
     if (code == 0 &&
-        op->dataVersion == op->scp->dataVersion - 1) {
-        /* only one set of changes happened between cm_BeginDirOp()
-           and this function.  It is safe for us to perform local
-           changes. */
+        op->dataVersion == op->scp->dataVersion - 1)
+    {
+        /*
+         * only one set of changes happened between cm_BeginDirOp()
+         * and this function.  It is safe for us to perform local
+         * changes. */
         op->newDataVersion = op->scp->dataVersion;
         op->newLength = op->scp->serverLength;
 
         rc = 1;
+    } else {
+        /*
+         * The directory buffers are no longer up to date.
+         */
+        op->scp->bufDataVersionLow = op->scp->dataVersion;
+
+        rc = 0;
     }
 
     if (rc)