]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-buf-flush-20061109
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 9 Nov 2006 21:25:28 +0000 (21:25 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 9 Nov 2006 21:25:28 +0000 (21:25 +0000)
FIXES 44330

The return value of buf_CleanAsync is not an error value but a flag
indicating whether or not the buffer was in fact dirty.  Do not treat
it as an error.  The error state is stored in the buffer itself.

src/WINNT/afsd/cm_buf.c

index 2052d3e56119991aa18ce76ad910e40e6fe9a774..1356eae18c63dba8b5607baa27715f66f36cc5e0 100644 (file)
@@ -1418,14 +1418,14 @@ long buf_FlushCleanPages(cm_scache_t *scp, cm_user_t *userp, cm_req_t *reqp)
 
 long buf_CleanVnode(struct cm_scache *scp, cm_user_t *userp, cm_req_t *reqp)
 {
-    long code;
+    long code = 0;
+    long wasDirty = 0;
     cm_buf_t *bp;              /* buffer we're hacking on */
     cm_buf_t *nbp;             /* next one */
     long i;
 
     i = BUF_FILEHASH(&scp->fid);
 
-    code = 0;
     lock_ObtainWrite(&buf_globalLock);
     bp = cm_data.buf_fileHashTablepp[i];
     if (bp) 
@@ -1442,12 +1442,11 @@ long buf_CleanVnode(struct cm_scache *scp, cm_user_t *userp, cm_req_t *reqp)
                 bp->userp = userp;
                 lock_ReleaseMutex(&bp->mx);
             }   
-            code = buf_CleanAsync(bp, reqp);
+            wasDirty = buf_CleanAsync(bp, reqp);
            buf_CleanWait(scp, bp);
             lock_ObtainMutex(&bp->mx);
             if (bp->flags & CM_BUF_ERROR) {
-                if (code == 0 || code == -1) 
-                    code = bp->error;
+               code = bp->error;
                 if (code == 0) 
                     code = -1;
             }