]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
prototyping caught this; the usage is inconsistent with other cases and
authorDerrick Brashear <shadow@dementia.org>
Sun, 21 Apr 2002 21:53:28 +0000 (21:53 +0000)
committerGarry Zacheiss <zacheiss@mit.edu>
Sun, 21 Apr 2002 21:53:28 +0000 (21:53 +0000)
i believe this is the correct fix. it's not clear to me why we weren't seeing
problems from this, though

(cherry picked from commit ef1ee322deb3a2e21c9d78a1b44375b8f7768de0)

src/afs/VNOPS/afs_vnop_write.c

index 8f8c598981e6f886b4f6953f483a56f986eb4e23..29c7a122f6d5f6c277802c4a8f3afa96077f0926 100644 (file)
@@ -256,9 +256,12 @@ afs_MemWrite(avc, auio, aio, acred, noLock)
 
        code = afs_MemWriteUIO(tdc->f.inode, &tuio);
        if (code) {
+           void *mep; /* XXX in prototype world is struct memCacheEntry * */
            error = code;
            ZapDCE(tdc);                /* bad data */
-           afs_MemCacheTruncate(tdc->f.inode, 0);
+           mep = afs_MemCacheOpen(tdc->f.inode);
+           afs_MemCacheTruncate(mep, 0);
+           afs_MemCacheClose(mep);
            afs_stats_cmperf.cacheCurrDirtyChunks--;
            afs_indexFlags[tdc->index] &= ~IFDataMod;    /* so it does disappear */
            afs_PutDCache(tdc);