From: Andrew Deason Date: Tue, 14 Sep 2010 16:15:22 +0000 (-0400) Subject: volser: Delete timed-out temporary volumes X-Git-Tag: openafs-devel-1_7_1~1565 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=bc56f5cc97a982ee29219e6f258b372dbfe1a020;hp=8fd83543b60aefb4b7c5a0116d1538a89f58bbb3 volser: Delete timed-out temporary volumes 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 Tested-by: BuildBot Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/volser/voltrans.c b/src/volser/voltrans.c index eb0c2a5..b350fa3 100644 --- a/src/volser/voltrans.c +++ b/src/volser/voltrans.c @@ -208,7 +208,26 @@ GCTrans(void) 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++; }