From aa9072ce40f7af11919252da82179b45481eb878 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 13 Nov 2009 13:56:20 -0500 Subject: [PATCH] Windows: cm_BkgDaemon requeuing only applies to BkgStore cm_BkgDaemon currently requeues failed requests for a variety of errors. It only applies to cm_BkgStore requests. The current code only supports cm_BkgStore and cm_BkgPrefetch operations. Additional background operations may be added in the future. If requeues are meant to apply to the new operations, they should be explicitly specified. Specify cm_BkgStore explicitly now. LICENSE MIT Change-Id: Iae7c5fe4f2f7bc701ebe93500626b68f49b0063f Reviewed-on: http://gerrit.openafs.org/824 Reviewed-by: Derrick Brashear Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/cm_daemon.c | 50 ++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/src/WINNT/afsd/cm_daemon.c b/src/WINNT/afsd/cm_daemon.c index 48c859d54..4c45cc37a 100644 --- a/src/WINNT/afsd/cm_daemon.c +++ b/src/WINNT/afsd/cm_daemon.c @@ -139,41 +139,43 @@ void cm_BkgDaemon(void * parm) osi_Log2(afsd_logp,"cm_BkgDaemon (after) scp 0x%x ref %d",rp->scp, rp->scp->refCount); #endif - /* + /* * Keep the following list synchronized with the * error code list in cm_BkgStore. * cm_SyncOpDone(CM_SCACHESYNC_ASYNCSTORE) will be called there unless * one of these errors has occurred. */ - switch ( code ) { - case CM_ERROR_TIMEDOUT: /* or server restarting */ - case CM_ERROR_RETRY: - case CM_ERROR_WOULDBLOCK: - case CM_ERROR_ALLBUSY: - case CM_ERROR_ALLDOWN: - case CM_ERROR_ALLOFFLINE: - case CM_ERROR_PARTIALWRITE: - osi_Log2(afsd_logp,"cm_BkgDaemon re-queueing failed request 0x%p code 0x%x", - rp, code); - lock_ObtainWrite(&cm_daemonLock); - cm_bkgQueueCount++; - osi_QAddT((osi_queue_t **) &cm_bkgListp, (osi_queue_t **)&cm_bkgListEndp, &rp->q); - break; - case 0: /* success */ - default: /* other error */ - if (code == 0) + switch ( code ) { + case CM_ERROR_TIMEDOUT: /* or server restarting */ + case CM_ERROR_RETRY: + case CM_ERROR_WOULDBLOCK: + case CM_ERROR_ALLBUSY: + case CM_ERROR_ALLDOWN: + case CM_ERROR_ALLOFFLINE: + case CM_ERROR_PARTIALWRITE: + if (rp->procp == cm_BkgStore) { + osi_Log2(afsd_logp, + "cm_BkgDaemon re-queueing failed request 0x%p code 0x%x", + rp, code); + lock_ObtainWrite(&cm_daemonLock); + cm_bkgQueueCount++; + osi_QAddT((osi_queue_t **) &cm_bkgListp, (osi_queue_t **)&cm_bkgListEndp, &rp->q); + break; + } /* otherwise fall through */ + case 0: /* success */ + default: /* other error */ + if (code == 0) osi_Log1(afsd_logp,"cm_BkgDaemon SUCCESS: request 0x%p", rp); else osi_Log2(afsd_logp,"cm_BkgDaemon FAILED: request dropped 0x%p code 0x%x", - rp, code); - cm_ReleaseUser(rp->userp); - cm_ReleaseSCache(rp->scp); - free(rp); + rp, code); + cm_ReleaseUser(rp->userp); + cm_ReleaseSCache(rp->scp); + free(rp); lock_ObtainWrite(&cm_daemonLock); - } + } } lock_ReleaseWrite(&cm_daemonLock); - thrd_SetEvent(cm_BkgDaemon_ShutdownEvent[daemonID]); } -- 2.39.5