]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: out of date version not in current chunk
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 28 Oct 2011 15:36:10 +0000 (11:36 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 15 Nov 2011 13:52:21 +0000 (05:52 -0800)
In buf_GetNewLocked(), the comparision to decide whether a
cm_buf_t is a member of the current chunk must take the data
version into account.  If the data version is out of date, it
is not part of the current chunk and is an object that can be
safely recycled.

Reviewed-on: http://gerrit.openafs.org/5734
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 1dad690fc34fdd8d9df8a3be6d580441b7cae8bb)

Change-Id: I626562d2189182b434f8da0f4f0a6213c5b695fe
Reviewed-on: http://gerrit.openafs.org/6042
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_buf.c

index e11276146cdc41b9f2ebc0c69968dae5c1939132..0c9d84ff0253fb7ab77153ccb72bc1ec20f79ef2 100644 (file)
@@ -1004,10 +1004,12 @@ long buf_GetNewLocked(struct cm_scache *scp, osi_hyper_t *offsetp, cm_req_t *req
                 continue;
 
             /* don't recycle someone in our own chunk */
-            if (!cm_FidCmp(&bp->fid, &scp->fid)
-                 && (bp->offset.LowPart & (-cm_chunkSize))
-                 == (offsetp->LowPart & (-cm_chunkSize)))
+            if (!cm_FidCmp(&bp->fid, &scp->fid) &&
+                bp->dataVersion >= scp->bufDataVersionLow &&
+                bp->dataVersion <= scp->dataVersion &&
+                (bp->offset.LowPart & (-cm_chunkSize)) == (offsetp->LowPart & (-cm_chunkSize))) {
                 continue;
+            }
 
             /* if this page is being filled (!) or cleaned, see if
              * the I/O has completed.  If not, skip it, otherwise