Windows: cm_BkgDaemon requeuing only applies to BkgStore
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 13 Nov 2009 18:56:20 +0000 (13:56 -0500)
committerJeffrey Altman <jaltman|account-1000011@unknown>
Thu, 19 Nov 2009 16:56:38 +0000 (08:56 -0800)
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 <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_daemon.c

index 48c859d..4c45cc3 100644 (file)
@@ -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]);
 }