]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
dafs-vol-updates-20080210
authorTom Keiser <tkeiser@sinenomine.net>
Mon, 11 Feb 2008 03:35:43 +0000 (03:35 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 11 Feb 2008 03:35:43 +0000 (03:35 +0000)
LICENSE IPL10

make sure status is consistent in vol package when doing dafs

src/vol/fssync-server.c
src/vol/volume.c
src/volser/volprocs.c

index 0f1705441a63a727e3b139fceee70a6f58bceec7..8914f539ca9127923057e0cd5de98d466ea2037a 100644 (file)
@@ -826,6 +826,7 @@ FSYNC_com_VolDone(FSSYNC_VolOp_command * vcom, SYNC_response * res)
 #ifdef AFS_DEMAND_ATTACH_FS
     vp = VLookupVolume_r(&error, vcom->vop->volume, NULL);
     if (vp) {
+       VChangeState_r(vp, VOL_STATE_UNATTACHED);
        VDeregisterVolOp_r(vp);
     }
 #endif
index 7138dbc58d7ba44aadfcec70b4ba59b24ffd1d75..379541fa5097bf01cf101269b4c2aa547ab1e56e 100644 (file)
@@ -1646,17 +1646,16 @@ VPreAttachVolumeByVp_r(Error * ec,
     /* check to see if pre-attach already happened */
     if (vp && 
        (V_attachState(vp) != VOL_STATE_UNATTACHED) && 
-       !VIsErrorState(V_attachState(vp)) &&
-       ((V_attachState(vp) != VOL_STATE_PREATTACHED) ||
-        vp->pending_vol_op == NULL)) {
+       (V_attachState(vp) != VOL_STATE_PREATTACHED) &&
+       !VIsErrorState(V_attachState(vp))) {
        /*
         * pre-attach is a no-op in all but the following cases:
         *
         *   - volume is unattached
         *   - volume is in an error state
-        *   - volume is pre-attached with a pending volume operation
-        *     (e.g. vos move between two partitions on same server)
+        *   - volume is pre-attached
         */
+       Log("VPreattachVolumeByVp_r: volume %u not in quiescent state\n", vid);
        goto done;
     } else if (vp) {
        /* we're re-attaching a volume; clear out some old state */
index ab6806ff35cf43a072bb1d56ff8904c6844bf811..c020648aeb61f2b9a8d2e5ca641483bca0effa22 100644 (file)
@@ -487,6 +487,7 @@ VolDeleteVolume(struct rx_call *acid, afs_int32 atrans)
     strcpy(tt->lastProcName, "DeleteVolume");
     tt->rxCallPtr = acid;
     VPurgeVolume(&error, tt->volume);  /* don't check error code, it is not set! */
+    V_destroyMe(tt->volume) = DESTROY_ME; /* so endtrans does the right fssync opcode */
     tt->vflags |= VTDeleted;   /* so we know not to do anything else to it */
     tt->rxCallPtr = (struct rx_call *)0;
     if (TRELE(tt))