diff --git a/src/WINNT/afsd/cm_daemon.c b/src/WINNT/afsd/cm_daemon.c index 3d96c850ec..0ab8bd5654 100644 --- a/src/WINNT/afsd/cm_daemon.c +++ b/src/WINNT/afsd/cm_daemon.c @@ -95,6 +95,8 @@ void cm_BkgDaemon(long parm) osi_assert(cm_bkgQueueCount-- > 0); lock_ReleaseWrite(&cm_daemonLock); + osi_Log1(afsd_logp,"cm_BkgDaemon processing request 0x%p", rp); + #ifdef DEBUG_REFCOUNT osi_Log2(afsd_logp,"cm_BkgDaemon (before) scp 0x%x ref %d",rp->scp, rp->scp->refCount); #endif @@ -111,7 +113,10 @@ void cm_BkgDaemon(long parm) lock_ObtainWrite(&cm_daemonLock); switch ( code ) { - case CM_ERROR_TIMEDOUT: + case 0: /* success */ + osi_Log1(afsd_logp,"cm_BkgDaemon SUCCESS: request 0x%p", rp); + break; + case CM_ERROR_TIMEDOUT: /* or server restarting */ case CM_ERROR_RETRY: case CM_ERROR_WOULDBLOCK: case CM_ERROR_ALLBUSY: @@ -124,7 +129,7 @@ void cm_BkgDaemon(long parm) osi_QAddT((osi_queue_t **) &cm_bkgListp, (osi_queue_t **)&cm_bkgListEndp, &rp->q); break; default: - osi_Log2(afsd_logp,"cm_BkgDaemon failed request dropped 0x%p code 0x%x", + osi_Log2(afsd_logp,"cm_BkgDaemon FAILED: request dropped 0x%p code 0x%x", rp, code); } } diff --git a/src/WINNT/afsd/cm_dcache.c b/src/WINNT/afsd/cm_dcache.c index 501ca8c549..dbcd5b79ba 100644 --- a/src/WINNT/afsd/cm_dcache.c +++ b/src/WINNT/afsd/cm_dcache.c @@ -99,7 +99,7 @@ long cm_BufWrite(void *vscp, osi_hyper_t *offsetp, long length, long flags, if (biod.length == 0) { osi_Log0(afsd_logp, "cm_SetupStoreBIOD length 0"); lock_ReleaseMutex(&scp->mx); - cm_ReleaseBIOD(&biod, 1); /* should be a NOOP */ + cm_ReleaseBIOD(&biod, 1, 0); /* should be a NOOP */ return 0; } @@ -303,7 +303,7 @@ long cm_BufWrite(void *vscp, osi_hyper_t *offsetp, long length, long flags, scp->flags |= CM_SCACHEFLAG_OVERQUOTA; } lock_ReleaseMutex(&scp->mx); - cm_ReleaseBIOD(&biod, 1); + cm_ReleaseBIOD(&biod, 1, code); return code; } @@ -1209,7 +1209,7 @@ long cm_SetupFetchBIOD(cm_scache_t *scp, osi_hyper_t *offsetp, /* release a bulk I/O structure that was setup by cm_SetupFetchBIOD or by * cm_SetupStoreBIOD */ -void cm_ReleaseBIOD(cm_bulkIO_t *biop, int isStore) +void cm_ReleaseBIOD(cm_bulkIO_t *biop, int isStore, int failed) { cm_scache_t *scp; /* do not release; not held in biop */ cm_buf_t *bufp; @@ -1250,7 +1250,10 @@ void cm_ReleaseBIOD(cm_bulkIO_t *biop, int isStore) osi_Log2(afsd_logp, "cm_ReleaseBIOD Waking [scp 0x%p] bp 0x%p", scp, bufp); osi_Wakeup((LONG_PTR) bufp); } - bufp->flags &= ~(CM_BUF_WRITING | CM_BUF_DIRTY); + if (failed) + bufp->flags &= ~CM_BUF_WRITING; + else + bufp->flags &= ~(CM_BUF_WRITING | CM_BUF_DIRTY); } lock_ReleaseMutex(&scp->mx); @@ -1340,7 +1343,7 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *up, bufp->dataVersion = scp->dataVersion; } lock_ReleaseMutex(&scp->mx); - cm_ReleaseBIOD(&biod, 0); + cm_ReleaseBIOD(&biod, 0, 0); lock_ObtainMutex(&scp->mx); return 0; } @@ -1647,7 +1650,7 @@ long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *up, /* release scatter/gather I/O structure (buffers, locks) */ lock_ReleaseMutex(&scp->mx); - cm_ReleaseBIOD(&biod, 0); + cm_ReleaseBIOD(&biod, 0, code); lock_ObtainMutex(&scp->mx); if (code == 0) diff --git a/src/WINNT/afsd/cm_dcache.h b/src/WINNT/afsd/cm_dcache.h index 64bbff6197..53741f52a4 100644 --- a/src/WINNT/afsd/cm_dcache.h +++ b/src/WINNT/afsd/cm_dcache.h @@ -37,7 +37,7 @@ extern long cm_CheckFetchRange(cm_scache_t *scp, osi_hyper_t *startBasep, extern long cm_SetupFetchBIOD(cm_scache_t *scp, osi_hyper_t *offsetp, cm_bulkIO_t *biop, cm_user_t *up, cm_req_t *reqp); -extern void cm_ReleaseBIOD(cm_bulkIO_t *biop, int isStore); +extern void cm_ReleaseBIOD(cm_bulkIO_t *biop, int isStore, int failed); extern long cm_SetupStoreBIOD(cm_scache_t *scp, osi_hyper_t *inOffsetp, long inSize, cm_bulkIO_t *biop, cm_user_t *userp, cm_req_t *reqp);