]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Windows: better handle RX_MSGSIZE errors
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 24 Aug 2010 20:42:57 +0000 (16:42 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Wed, 8 Sep 2010 03:45:28 +0000 (20:45 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit b11ff643b5665ec252ca96dc19af1446fb72481f)
Reviewed-on: http://gerrit.openafs.org/2703

src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_utils.c

index a284cf27668ebb5df5aee8e8b2072e97f5c5355e..8c060a80123017d74e56fe229810693d831a6346 100644 (file)
@@ -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;
index 58a94cbeeaa881f59a5d56ae01bc90d92590c4f4..2312464567d392dea0897b806d3ce221a4a7a2e5 100644 (file)
@@ -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;