force-vol-upd-20040724
authorJeffrey Altman <jaltman@mit.edu>
Sat, 24 Jul 2004 19:59:32 +0000 (19:59 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 24 Jul 2004 19:59:32 +0000 (19:59 +0000)
Change cm_ForceUpdateVolume to not try to perform an immediate update.
Just set the CM_VOLUMEFLAG_RESET flag.  Calling cm_UpdateVolume calls
cm_connByMServers which then calls cm_Analyze which is how we ended
up having cm_ForceUpdateVolume called in the first place.

src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_volume.c

index b1ee331..6c6ae21 100644 (file)
@@ -201,7 +201,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
            osi_Log0(afsd_logp, "cm_Analyze passed CM_ERROR_ALLOFFLINE.");
            thrd_Sleep(5000);
            /* cm_ForceUpdateVolume marks all servers as non_busy */
-               /* No it doesn't.  It won't do anything if all of the 
+               /* No it doesn't and it won't do anything if all of the 
                 * the servers are marked as DOWN.  So clear the DOWN
                 * flag and reset the busy state as well.
                 */
@@ -214,8 +214,9 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
                }
         lock_ReleaseWrite(&cm_serverLock);
 
-        if (fidp != NULL)
+        if (fidp != NULL)   /* Not a VLDB call */
             cm_ForceUpdateVolume(fidp, userp, reqp);
+
            retry = 1;
        }
 
index 723dcf7..7143a52 100644 (file)
@@ -287,9 +287,21 @@ void cm_ForceUpdateVolume(cm_fid_t *fidp, cm_user_t *userp, cm_req_t *reqp)
        cm_mountRootGen++;
        lock_ObtainMutex(&volp->mx);
        volp->flags |= CM_VOLUMEFLAG_RESET;
+#ifdef COMMENT
+    /* Mark the volume to be updated but don't update it now.
+     * This function is called only from within cm_Analyze
+     * when cm_ConnByMServers has failed with all servers down
+     * The problem is that cm_UpdateVolume is going to call
+     * cm_ConnByMServers which may cause a recursive chain
+     * of calls each returning a retry on failure.
+     * Instead, set the flag so the next time the volume is
+     * accessed by Name or ID the UpdateVolume call will
+     * occur.
+     */
        code = cm_UpdateVolume(cellp, userp, reqp, volp);
        if (code == 0)
                volp->flags &= ~CM_VOLUMEFLAG_RESET;
+#endif
        lock_ReleaseMutex(&volp->mx);
 
        cm_PutVolume(volp);