From: Jeffrey Altman Date: Fri, 28 Oct 2011 15:36:10 +0000 (-0400) Subject: Windows: out of date version not in current chunk X-Git-Tag: upstream/1.6.1.pre1^2~104 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=92f5218bce982e26d26e72ccc4598f2af0da7899;p=packages%2Fo%2Fopenafs.git Windows: out of date version not in current chunk 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 Tested-by: BuildBot Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman (cherry picked from commit 1dad690fc34fdd8d9df8a3be6d580441b7cae8bb) Change-Id: I626562d2189182b434f8da0f4f0a6213c5b695fe Reviewed-on: http://gerrit.openafs.org/6042 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index e11276146..0c9d84ff0 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -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