Windows: Client handling of VNOSERVICE
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 22 Mar 2012 19:55:47 +0000 (15:55 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 22 Mar 2012 22:10:15 +0000 (15:10 -0700)
VNOSERVICE should not be grouped together with the volume status
error codes.  It is used to indicate that the RPC was not serviced.
The file server issues it when its idle dead timeout period is reached
while receiving rx call data.  The client's existing status information
is still valid and the client can retry the call.

Reviewed-on: http://gerrit.openafs.org/6938
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 39964d08792f3a09694f97d7c7fa76a86ca213a7)

Change-Id: I96b831e3a2eae04e96062f9c269eb7325e76c439
Reviewed-on: http://gerrit.openafs.org/6941
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsd/cm_conn.c

index 896834a..f6a644e 100644 (file)
@@ -562,7 +562,7 @@ cm_Analyze(cm_conn_t *connp,
 
     /* special codes:  missing volumes */
     else if (errorCode == VNOVOL || errorCode == VMOVED || errorCode == VOFFLINE ||
-             errorCode == VSALVAGE || errorCode == VNOSERVICE || errorCode == VIO)
+             errorCode == VSALVAGE || errorCode == VIO)
     {
         /* In case of timeout */
         reqp->volumeError = errorCode;
@@ -584,10 +584,6 @@ cm_Analyze(cm_conn_t *connp,
            msgID = MSG_SERVER_REPORTS_VSALVAGE;
             format = "Server %s reported volume %d in cell %s as needs salvage.";
             break;
-        case VNOSERVICE:
-           msgID = MSG_SERVER_REPORTS_VNOSERVICE;
-            format = "Server %s reported volume %d in cell %s as not in service.";
-            break;
         case VIO:
            msgID = MSG_SERVER_REPORTS_VIO;
             format = "Server %s reported volume %d in cell %s as temporarily unaccessible.";
@@ -823,6 +819,33 @@ cm_Analyze(cm_conn_t *connp,
                  osi_LogSaveString(afsd_logp,addr));
         retry = 1;
     }
+    else if (errorCode == VNOSERVICE) {
+        /*
+         * The server did not service the RPC.
+         * If this was a file server RPC it means that for at
+         * least the file server's idle dead timeout period the
+         * file server did not receive any new data packets from
+         * client.
+         *
+         * The RPC was not serviced so it can be retried and any
+         * existing status information is still valid.
+         */
+        if (fidp) {
+            if (serverp)
+                sprintf(addr, "%d.%d.%d.%d",
+                        ((serverp->addr.sin_addr.s_addr & 0xff)),
+                        ((serverp->addr.sin_addr.s_addr & 0xff00)>> 8),
+                        ((serverp->addr.sin_addr.s_addr & 0xff0000)>> 16),
+                        ((serverp->addr.sin_addr.s_addr & 0xff000000)>> 24));
+
+            LogEvent(EVENTLOG_WARNING_TYPE, MSG_SERVER_REPORTS_VNOSERVICE, addr);
+            osi_Log1(afsd_logp, "Server %s reported volume %d in cell %s as not in service.",
+                     osi_LogSaveString(afsd_logp,addr), fidp->volume, cellp->name);
+        }
+
+        if (timeLeft > 2)
+            retry = 1;
+    }
     else if (errorCode == RX_CALL_IDLE) {
         /*
          * RPC failed because the server failed to respond with data