windows-scache-clean-bufs-20080224
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 24 Feb 2008 15:33:52 +0000 (15:33 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 24 Feb 2008 15:33:52 +0000 (15:33 +0000)
LICENSE MIT

In MergeStatus, only remove clean buffers from the hash table.

src/WINNT/afsd/cm_scache.c

index 9aa0475..564f5cb 100644 (file)
@@ -1686,7 +1686,8 @@ void cm_MergeStatus(cm_scache_t *dscp,
              */
             if (cm_FidCmp(&scp->fid, &bp->fid) == 0 &&
                  lock_TryMutex(&bp->mx)) {
-                if (bp->refCount == 0) {
+                if (bp->refCount == 0 && 
+                    !(bp->flags & CM_BUF_READING | CM_BUF_WRITING | CM_BUF_DIRTY)) {
                     prevBp = bp->fileHashBackp;
                     bp->fileHashBackp = bp->fileHashp = NULL;
                     if (prevBp)