afs-memcachetruncate-takes-memcacheentry-not-inode-20020321
authorDerrick Brashear <shadow@dementia.org>
Thu, 21 Mar 2002 18:44:19 +0000 (18:44 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 21 Mar 2002 18:44:19 +0000 (18:44 +0000)
prototyping caught this; the usage is inconsistent with other cases and
i believe this is the correct fix. it's not clear to me why we weren't seeing
problems from this, though

src/afs/VNOPS/afs_vnop_write.c

index 193f7aa..c598b64 100644 (file)
@@ -260,9 +260,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 */
            ReleaseWriteLock(&tdc->lock);