Windows: Protect against infinite VIO retries
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 17 May 2013 16:06:00 +0000 (12:06 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Sat, 18 May 2013 03:14:04 +0000 (20:14 -0700)
Keep track of the number of VIO errors reported by the file servers.
If the count exceeds 100, abandon the request.

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

src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_conn.h

index b007f40..eb8fd3b 100644 (file)
@@ -832,6 +832,12 @@ cm_Analyze(cm_conn_t *connp,
             reqp->vnovolError++;
         }
 
+        /* Remember that the VIO error occurred */
+        if (errorCode == VIO) {
+            reqp->errorServp = serverp;
+            reqp->vioCount++;
+        }
+
         /* Free the server list before cm_ForceUpdateVolume is called */
         if (free_svr_list) {
             cm_FreeServerList(volServerspp, 0);
@@ -839,7 +845,7 @@ cm_Analyze(cm_conn_t *connp,
             free_svr_list = 0;
         }
 
-        if ( timeLeft > 2 )
+        if ( timeLeft > 2 && reqp->vioCount < 100)
             retry = 1;
     } else if ( errorCode == VNOVNODE ) {
        if (connp)
index f81371a..e8b1076 100644 (file)
@@ -68,6 +68,7 @@ typedef struct cm_req {
     int idleError;
     int vnovolError;
     int volbusyCount;
+    int vioCount;
     afs_uint32 flags;
     clientchar_t * tidPathp;
     clientchar_t * relPathp;