Windows: RDR_RequestFileExtentsAsync set current DV
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 2 May 2012 21:58:39 +0000 (17:58 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 4 May 2012 17:26:04 +0000 (10:26 -0700)
if the buffer returned from cm_GetBuffer() has an offset that is
beyond the serverLength and it has a "bad" data version, set the
data version to the current value.  This is for debugging clarity.

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

src/WINNT/afsrdr/user/RDRFunction.c

index a75acba..5d19f3a 100644 (file)
@@ -3299,11 +3299,15 @@ RDR_RequestFileExtentsAsync( IN cm_user_t *userp,
                 else
                     minLength = scp->length;
 
-                if (!bHaveBuffer &&
-                    LargeIntegerGreaterThanOrEqualTo(bufp->offset, minLength)) {
-                    memset(bufp->datap, 0, cm_data.buf_blockSize);
-                    bufp->dataVersion = scp->dataVersion;
-                    bHaveBuffer = TRUE;
+                if (LargeIntegerGreaterThanOrEqualTo(bufp->offset, minLength)) {
+                    if (!bHaveBuffer) {
+                        memset(bufp->datap, 0, cm_data.buf_blockSize);
+                        bufp->dataVersion = scp->dataVersion;
+                        bHaveBuffer = TRUE;
+                    }
+                    else if (bufp->dataVersion == CM_BUF_VERSION_BAD) {
+                        bufp->dataVersion = scp->dataVersion;
+                    }
                 }
                 else if ((RequestExtentsCB->Flags & AFS_EXTENT_FLAG_CLEAN) &&
                          ByteOffset.QuadPart <= bufp->offset.QuadPart &&