Windows: Pass Volume Root Fid to cm_Analyze after RXAFS_GetVolumeStatus
authorJeffrey Altman <jaltman@your-file-system.com>
Sat, 2 Oct 2010 04:49:38 +0000 (00:49 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Sat, 2 Oct 2010 15:51:45 +0000 (08:51 -0700)
RXAFS_GetVolumeStatus can return VNOVOL, VMOVED, etc.  In order to
process them and update volume state a fid must be passed to cm_Analyze().
Use the volume root fid.

LICENSE MIT

Change-Id: Ia6115a17aae06144277271048e8287e5ad52ff2a
Reviewed-on: http://gerrit.openafs.org/2883
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_volume.c

index ffdfa43..266b507 100644 (file)
@@ -1145,7 +1145,6 @@ long cm_GetROVolumeID(cm_volume_t *volp)
 void cm_RefreshVolumes(int lifetime)
 {
     cm_volume_t *volp;
-    cm_scache_t *scp;
     afs_int32 refCount;
     time_t now;
 
@@ -1195,12 +1194,16 @@ cm_CheckOfflineVolumeState(cm_volume_t *volp, cm_vol_state_t *statep, afs_uint32
     char motd[256];
     long alldown, alldeleted;
     cm_serverRef_t *serversp;
+    cm_fid_t fid;
 
     Name = volName;
     OfflineMsg = offLineMsg;
     MOTD = motd;
 
     if (statep->ID != 0 && (!volID || volID == statep->ID)) {
+        /* create fid for volume root so that VNOVOL and VMOVED errors can be processed */
+        cm_SetFid(&fid, volp->cellp->cellID, statep->ID, 1, 1);
+
         if (!statep->serversp && !(*volumeUpdatedp)) {
             cm_InitReq(&req);
             code = cm_UpdateVolumeLocation(volp->cellp, cm_rootUserp, &req, volp);
@@ -1242,8 +1245,7 @@ cm_CheckOfflineVolumeState(cm_volume_t *volp, cm_vol_state_t *statep, afs_uint32
                     code = RXAFS_GetVolumeStatus(rxconnp, statep->ID,
                                                  &volStat, &Name, &OfflineMsg, &MOTD);
                     rx_PutConnection(rxconnp);            
-
-                } while (cm_Analyze(connp, cm_rootUserp, &req, NULL, NULL, NULL, NULL, code));
+                } while (cm_Analyze(connp, cm_rootUserp, &req, &fid, NULL, NULL, NULL, code));
                 code = cm_MapRPCError(code, &req);
 
                 lock_ObtainWrite(&volp->rw);