afs-analyze-avoid-potential-loop-20030423
[openafs.git] / src / afs / afs_analyze.c
index a9af1eb..14d0068 100644 (file)
@@ -246,7 +246,7 @@ int afs_CheckCode(afs_int32 acode, struct vrequest *areq, int where)
        afs_Trace2(afs_iclSetp, CM_TRACE_CHECKCODE,
                   ICL_TYPE_INT32, acode, ICL_TYPE_INT32, where);
     }
-    if (acode & ~0xff == ERROR_TABLE_BASE_uae) 
+    if ((acode & ~0xff) == ERROR_TABLE_BASE_uae) 
        acode = et_to_sys_error(acode);
     if (!areq || !areq->initd)
        return acode;
@@ -469,10 +469,10 @@ int afs_Analyze(register struct conn *aconn, afs_int32 acode,
 
         for (i=0; i < MAXHOSTS; i++) {
            if (tvp->status[i] != not_busy && tvp->status[i] != offline) {
-              tvp->status[i] = not_busy; 
+               tvp->status[i] = not_busy; 
            }
-           if (tvp->status[i] == not_busy)
-                shouldRetry = 1;
+           if (tvp->status[i] == not_busy) 
+               shouldRetry = 1;
         }
         afs_PutVolume(tvp, READ_LOCK);
       } else {
@@ -488,6 +488,9 @@ int afs_Analyze(register struct conn *aconn, afs_int32 acode,
       } else {
        VSleep(afs_BusyWaitPeriod);         /* poll periodically */
       }
+      if (shouldRetry != 0)
+         areq->busyCount++;
+
       return shouldRetry; /* should retry */
     }
          
@@ -533,7 +536,7 @@ int afs_Analyze(register struct conn *aconn, afs_int32 acode,
 
     /* Before we do anything with acode, make sure we translate it back to
        a system error */
-    if (acode & ~0xff == ERROR_TABLE_BASE_uae) 
+    if ((acode & ~0xff) == ERROR_TABLE_BASE_uae) 
        acode = et_to_sys_error(acode);
 
     if (acode == 0) {