]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
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)
committerDerrick Brashear <shadow@dementia.org>
Mon, 25 Oct 2010 21:34:51 +0000 (14:34 -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

Reviewed-on: http://gerrit.openafs.org/2883
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 59e6ac8a5c354b746a4b984f4a10af91ebeef5f3)
Change-Id: I20a902e9e3074334764954faf297200e5dc60b80
Reviewed-on: http://gerrit.openafs.org/3133
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/WINNT/afsd/cm_volume.c

index ffdfa43fa7046c1799e057abd27545b7868f8a29..266b507557a626f12a16cf783c3ca3ec0a3b8193 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);