From d4f6ece19b05f2233e53f2d3c59f92316ec5ec3a Mon Sep 17 00:00:00 2001 From: Dan Hyde Date: Wed, 13 Jan 2010 14:38:47 -0500 Subject: [PATCH] volmonitor keep vtrans lock VolMonitor must maintain the VTRANS lock the whole time it is walking the allTrans list. Failure to do so can cause core dumps trying to access memory that has already been free'd. Two versions of this change were coded and tested. The other version used the VTRANS lock only around a THOLD, but needed a TRELE, too. Timing tests were run counting the number of vos status, vos listvol, and vos backupsys operations that could be performed during a fixed number of vos status operations. The THOLD/TRELE version caused other vos operations to run about 5% slower. FIXES 126110 Change-Id: I7e749d30c955867faacafa978d7d643dee648ca3 Reviewed-on: http://gerrit.openafs.org/1098 Reviewed-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/volser/volprocs.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 87ead7472..583800891 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -2774,9 +2774,7 @@ VolMonitor(struct rx_call *acid, transDebugEntries *transInfo) if (allTrans == (struct volser_trans *)0) goto done; /*no active transactions */ for (tt = allTrans; tt; tt = nt) { /*copy relevant info into pntr */ - THOLD(tt); /* do not delete tt while copying info */ nt = tt->next; - VTRANS_UNLOCK; VTRANS_OBJ_LOCK(tt); pntr->tid = tt->tid; pntr->time = tt->time; @@ -2813,8 +2811,6 @@ VolMonitor(struct rx_call *acid, transDebugEntries *transInfo) /*set pntr to right position */ } - TRELE(tt); - VTRANS_LOCK; } done: VTRANS_UNLOCK; -- 2.39.5