From 436836d81ad17d78ddfe794db0c3bbf8f31a2783 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 17 May 2013 12:06:00 -0400 Subject: [PATCH] Windows: Protect against infinite VIO retries 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 Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/cm_conn.c | 8 +++++++- src/WINNT/afsd/cm_conn.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index b007f408c..eb8fd3b06 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -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) diff --git a/src/WINNT/afsd/cm_conn.h b/src/WINNT/afsd/cm_conn.h index f81371a23..e8b1076e2 100644 --- a/src/WINNT/afsd/cm_conn.h +++ b/src/WINNT/afsd/cm_conn.h @@ -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; -- 2.39.5