]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
client-omit-zero-length-reads-20050804
authorRainer Toebbicke <rtb@pclella.cern.ch>
Thu, 4 Aug 2005 20:31:33 +0000 (20:31 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 4 Aug 2005 20:31:33 +0000 (20:31 +0000)
The attached patch restores the behaviour of the 1.2.x client: writes
appending to a file do not trigger a 0-length read which at best updates the
current status. If another cache manager wrote to the same file in the
meantime, the file status is updated only after the StoreData RPC (and for
the changes the last one wins).

src/afs/afs_dcache.c

index 2fa7a2a85635281a5916be31c7211d480f8163f4..c57093fc17fbff02d30fcab30aeeabbf504423c3 100644 (file)
@@ -1965,7 +1965,8 @@ afs_GetDCache(register struct vcache *avc, afs_size_t abyte,
               ICL_HANDLE_OFFSET(Position));
     if ((aflags & 4) && (hiszero(avc->m.DataVersion)))
        doAdjustSize = 1;
-    if ((aflags & 4) && (abyte == Position) && (tlen >= size))
+    if ((AFS_CHUNKTOBASE(chunk) >= avc->m.Length) ||
+        ((aflags & 4) && (abyte == Position) && (tlen >= size))))
        overWriteWholeChunk = 1;
     if (doAdjustSize || overWriteWholeChunk) {
 #if    defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV)