From 1a711beba6e8e0ea402a5c85f58263fe508eab3d Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 24 Jul 2004 19:59:32 +0000 Subject: [PATCH] force-vol-upd-20040724 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 | 5 +++-- src/WINNT/afsd/cm_volume.c | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index b1ee331..6c6ae21 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -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; } diff --git a/src/WINNT/afsd/cm_volume.c b/src/WINNT/afsd/cm_volume.c index 723dcf7..7143a52 100644 --- a/src/WINNT/afsd/cm_volume.c +++ b/src/WINNT/afsd/cm_volume.c @@ -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); -- 1.9.4