From: Rainer Toebbicke Date: Thu, 4 Aug 2005 21:45:14 +0000 (+0000) Subject: STABLE14-client-omit-zero-length-reads-20050804 X-Git-Tag: openafs-devel-1_3_87~8 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=1ff99ae82693d49fc42e5433f750ddee91125d32;p=packages%2Fo%2Fopenafs.git STABLE14-client-omit-zero-length-reads-20050804 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). --- diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 06c3846b4..9f3d81aea 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -1815,7 +1815,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)