From: Tom Keiser Date: Mon, 11 Feb 2008 03:35:43 +0000 (+0000) Subject: dafs-vol-updates-20080210 X-Git-Tag: BP-openafs-windows-kdfs-ifs~121 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=c61712de68f6bcb59eac29cb59e9ae78d98cf179 dafs-vol-updates-20080210 LICENSE IPL10 make sure status is consistent in vol package when doing dafs --- diff --git a/src/vol/fssync-server.c b/src/vol/fssync-server.c index 0f17054..8914f53 100644 --- a/src/vol/fssync-server.c +++ b/src/vol/fssync-server.c @@ -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 diff --git a/src/vol/volume.c b/src/vol/volume.c index 7138dbc..379541f 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -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 */ diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index ab6806f..c020648 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -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))