Windows: Preserve volume location info in case of comm fail
authorJeffrey Altman <jaltman@your-file-system.com>
Sun, 18 Apr 2010 17:34:18 +0000 (18:34 +0100)
committerJeffrey Altman <jaltman@openafs.org>
Sun, 18 Apr 2010 17:53:33 +0000 (10:53 -0700)
The cache manager refreshes volume location information every
two hours. If during a refresh the communication with the
vldb server fails, the previously known volume location information
should continue to be used.

The previous behavior in which the volume location information
is discarded first and then the update is performed can result
in unnecessary client failures when a temporary disruption in
communication with the vldb server occurs.  Instead, wait until
we have a successful response from the vldb server before the
previous server list is discarded.

LICENSE MIT

Change-Id: I7c63c4f673a7a1360a74611c356329f31f9ceec3
Reviewed-on: http://gerrit.openafs.org/1769
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_volume.c

index 053f379..9976fe5 100644 (file)
@@ -217,12 +217,6 @@ long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *
             }
         }
 
-        /* clear out old bindings */
-        for ( volType = RWVOL; volType < NUM_VOL_TYPES; volType++) {
-            if (volp->vol[volType].serversp)
-                cm_FreeServerList(&volp->vol[volType].serversp, CM_FREESERVERLIST_DELETE);
-        }
-
         volp->flags |= CM_VOLUMEFLAG_UPDATING_VL;
         lock_ReleaseWrite(&volp->rw);
 
@@ -338,6 +332,12 @@ long cm_UpdateVolumeLocation(struct cm_cell *cellp, cm_user_t *userp, cm_req_t *
            rwServers_alldown = 0;
 #endif
 
+        /* clear out old bindings */
+        for ( volType = RWVOL; volType < NUM_VOL_TYPES; volType++) {
+            if (volp->vol[volType].serversp)
+                cm_FreeServerList(&volp->vol[volType].serversp, CM_FREESERVERLIST_DELETE);
+        }
+
         memset(serverUUID, 0, sizeof(serverUUID));
 
         switch ( method ) {