From b11ff643b5665ec252ca96dc19af1446fb72481f Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 24 Aug 2010 16:42:57 -0400 Subject: [PATCH] Windows: better handle RX_MSGSIZE errors An RX_MSGSIZE error is returned by the new PMTU detection code. It is critical that such an error result in a retry of the operation that failed. Otherwise, the PMTU detection can't work and the server will be marked down. Secondly, it is important that such errors not leak to the application layer. Map them to CM_ERROR_RETRY in all cases. LICENSE MIT Change-Id: I966fe259080bd31ec60fdb6715f54e18e190c790 Reviewed-on: http://gerrit.openafs.org/2656 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsd/cm_conn.c | 5 ++--- src/WINNT/afsd/cm_utils.c | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index a284cf2766..8c060a8012 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -740,8 +740,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp, osi_LogSaveString(afsd_logp,addr)); } - if (timeLeft > 2) - retry = 1; + retry = 1; } else if (errorCode >= -64 && errorCode < 0) { /* mark server as down */ @@ -967,7 +966,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp, } /* If not allowed to retry, don't */ - if (!forcing_new && (reqp->flags & CM_REQ_NORETRY)) + if (!forcing_new && (reqp->flags & CM_REQ_NORETRY) && (errorCode != RX_MSGSIZE)) retry = 0; else if (retry && dead_session) retry = 0; diff --git a/src/WINNT/afsd/cm_utils.c b/src/WINNT/afsd/cm_utils.c index 58a94cbeea..2312464567 100644 --- a/src/WINNT/afsd/cm_utils.c +++ b/src/WINNT/afsd/cm_utils.c @@ -209,10 +209,13 @@ long cm_MapRPCError(long error, cm_req_t *reqp) error = et_to_sys_error(error); if (error == RX_CALL_DEAD || - error == RX_CALL_TIMEOUT) + error == RX_CALL_TIMEOUT || + error == RX_MSGSIZE) error = CM_ERROR_RETRY; else if (error < 0) error = CM_ERROR_UNKNOWN; + else if (error == EINVAL) + error = CM_ERROR_INVAL; else if (error == EROFS) error = CM_ERROR_READONLY; else if (error == EACCES) @@ -270,7 +273,8 @@ long cm_MapRPCErrorRmdir(long error, cm_req_t *reqp) error = et_to_sys_error(error); if (error == RX_CALL_DEAD || - error == RX_CALL_TIMEOUT) + error == RX_CALL_TIMEOUT || + error == RX_MSGSIZE) error = CM_ERROR_RETRY; else if (error == VNOVNODE) error = CM_ERROR_BADFD; @@ -288,6 +292,8 @@ long cm_MapRPCErrorRmdir(long error, cm_req_t *reqp) error = CM_ERROR_NOACCESS; else if (error == ENOENT) error = CM_ERROR_NOSUCHFILE; + else if (error == EINVAL) + error = CM_ERROR_INVAL; else if (error == ENOTEMPTY || error == 17 /* AIX */ || error == 66 /* SunOS 4, Digital UNIX */ @@ -315,12 +321,15 @@ long cm_MapVLRPCError(long error, cm_req_t *reqp) error = et_to_sys_error(error); if (error == RX_CALL_DEAD || - error == RX_CALL_TIMEOUT) + error == RX_CALL_TIMEOUT || + error == RX_MSGSIZE) error = CM_ERROR_RETRY; else if (error == RX_RESTARTING) error = CM_ERROR_ALLBUSY; else if (error < 0) error = CM_ERROR_UNKNOWN; + else if (error == EINVAL) + error = CM_ERROR_INVAL; else if (error == VL_NOENT || error == VL_BADNAME) error = CM_ERROR_NOSUCHVOLUME; return error;