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_5_78~143 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3bbcfde65e30581b2d5c66d3a1592fe942581cf7;p=packages%2Fo%2Fopenafs.git 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 (cherry picked from commit bc56f5cc97a982ee29219e6f258b372dbfe1a020) Reviewed-on: http://gerrit.openafs.org/2799 --- diff --git a/src/volser/voltrans.c b/src/volser/voltrans.c index eb0c2a58d..b350fa383 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++; }