Windows: cm_Analyze if no retry don't sleep
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 8 May 2013 18:08:59 +0000 (14:08 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Wed, 8 May 2013 21:21:39 +0000 (14:21 -0700)
If error handling response is not going to result in a retry of the
call, do not sleep.

Change-Id: I12435612f94a2e6afb77b5a2975f90f66e02823a
Reviewed-on: http://gerrit.openafs.org/9881
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsd/cm_conn.c

index 686e7c7..b007f40 100644 (file)
@@ -519,7 +519,9 @@ cm_Analyze(cm_conn_t *connp,
                  * Do not perform a cm_CheckOfflineVolume() if cm_Analyze()
                  * was called by cm_CheckOfflineVolumeState().
                  */
-                if (!(reqp->flags & CM_REQ_OFFLINE_VOL_CHK) && timeLeft > 7) {
+               if (!(reqp->flags & (CM_REQ_OFFLINE_VOL_CHK|CM_REQ_NORETRY)) &&
+                   timeLeft > 7)
+               {
                     thrd_Sleep(5000);
 
                     /* cm_CheckOfflineVolume() resets the serverRef state */
@@ -568,7 +570,9 @@ cm_Analyze(cm_conn_t *connp,
                 * retry all replicas for 5 minutes waiting 15 seconds
                 * between attempts.
                 */
-               if (timeLeft > 20 && reqp->volbusyCount++ < 20) {
+               if (timeLeft > 20 && !(reqp->flags & CM_REQ_NORETRY) &&
+                   reqp->volbusyCount++ < 20)
+               {
                    thrd_Sleep(15000);
                     retry = 1;
                 }
@@ -582,13 +586,12 @@ cm_Analyze(cm_conn_t *connp,
         } else {    /* VL Server query */
             osi_Log0(afsd_logp, "cm_Analyze passed CM_ERROR_ALLBUSY (VL Server).");
 
-            if (timeLeft > 7) {
+           if (timeLeft > 7 && !(reqp->flags & CM_REQ_NORETRY) && vlServerspp)
+           {
                 thrd_Sleep(5000);
 
-                if (vlServerspp) {
-                    cm_ResetServerBusyStatus(vlServerspp);
-                    retry = 1;
-                }
+               cm_ResetServerBusyStatus(vlServerspp);
+               retry = 1;
             }
         }
     }