When a transaction times out on a volume, delete the volume if it is a
temporary volume (destroyMe is set). This prevents half-created
volumes from accumulating, which can take up space and screw up
certain vol ops in some versions.
Change-Id: I94e9adc767b84a2a32d980f508af33b823560950
Reviewed-on: http://gerrit.openafs.org/2760
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
continue;
if (tt->time + OLDTRANSTIME < now) {
Log("trans %u on volume %u has timed out\n", tt->tid, tt->volid);
+
tt->refCount++; /* we're using it now */
+
+ if (tt->volume && V_destroyMe(tt->volume) == DESTROY_ME
+ && !(tt->vflags & VTDeleted)) {
+
+ Error error;
+
+ Log("Deleting timed-out temporary volume %lu\n",
+ (long unsigned) tt->volid);
+
+ VTRANS_OBJ_LOCK(tt);
+ tt->vflags |= VTDeleted;
+ VTRANS_OBJ_UNLOCK(tt);
+
+ VTRANS_UNLOCK;
+ VPurgeVolume(&error, tt->volume);
+ VTRANS_LOCK;
+ }
+
DeleteTrans(tt, 0); /* drops refCount or deletes it */
GCDeletes++;
}