novolume-20040725
authorJeffrey Altman <jaltman@mit.edu>
Mon, 26 Jul 2004 03:48:47 +0000 (03:48 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 26 Jul 2004 03:48:47 +0000 (03:48 +0000)
if we are going to return CM_ERROR_NOSUCHVOLUME do it whenever the
server list is empty.  If the server list is empty, allDown and allBusy
will always be set but there is nothing we can do.

src/WINNT/afsd/cm_conn.c

index 6c6ae21..856f31d 100644 (file)
@@ -206,18 +206,20 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
                 * flag and reset the busy state as well.
                 */
                cm_GetServerList(fidp, userp, reqp, &serversp);
-               lock_ObtainWrite(&cm_serverLock);
-               for (tsrp = serversp; tsrp; tsrp=tsrp->next) {
-               tsrp->server->flags &= ~CM_SERVERFLAG_DOWN;
-                       if (tsrp->status == busy)
-                               tsrp->status = not_busy;
-               }
-        lock_ReleaseWrite(&cm_serverLock);
+        if (serversp) {
+            lock_ObtainWrite(&cm_serverLock);
+            for (tsrp = serversp; tsrp; tsrp=tsrp->next) {
+                tsrp->server->flags &= ~CM_SERVERFLAG_DOWN;
+                if (tsrp->status == busy)
+                    tsrp->status = not_busy;
+            }
+            lock_ReleaseWrite(&cm_serverLock);
+
+            retry = 1;
+        }
 
         if (fidp != NULL)   /* Not a VLDB call */
             cm_ForceUpdateVolume(fidp, userp, reqp);
-
-           retry = 1;
        }
 
        /* if all servers are busy, mark them non-busy and start over */
@@ -409,15 +411,12 @@ long cm_ConnByMServers(cm_serverRef_t *serversp, cm_user_t *usersp,
 
        lock_ReleaseWrite(&cm_serverLock);
        if (firstError == 0) {
-               if (allDown) 
+        if (serversp == NULL)
+                       firstError = CM_ERROR_NOSUCHVOLUME;
+        else if (allDown) 
                        firstError = CM_ERROR_ALLOFFLINE;
                else if (allBusy) 
                        firstError = CM_ERROR_ALLBUSY;
-               else if (serversp == NULL) 
-                       /* Only return CM_ERROR_NOSUCHVOLUME if there are no
-                        * servers for this volume 
-                        */
-                       firstError = CM_ERROR_NOSUCHVOLUME;
                else
                        firstError = CM_ERROR_TIMEDOUT;
        }