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 0f17054..8914f53 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 7138dbc..379541f 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 ab6806f..c020648 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))