#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
/* 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 */
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))