From 398ceb0775a0663829ce4c44a8ec08d9e63bd1ca Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 9 Nov 2006 21:25:28 +0000 Subject: [PATCH] windows-buf-flush-20061109 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 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/WINNT/afsd/cm_buf.c b/src/WINNT/afsd/cm_buf.c index 2052d3e56..1356eae18 100644 --- a/src/WINNT/afsd/cm_buf.c +++ b/src/WINNT/afsd/cm_buf.c @@ -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; } -- 2.39.5