From 76ac9aa20f3ab8a1cbbb83ad76914f0bd0618ef7 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 (cherry picked from commit d4f6ece19b05f2233e53f2d3c59f92316ec5ec3a) Change-Id: Ic12bb6687a9c34e85abc2023c02264de6ae27614 Reviewed-on: http://gerrit.openafs.org/1588 Reviewed-by: Dan Hyde Tested-by: Dan Hyde (cherry picked from commit 190ef2cb29577f2fcf1853149cf210fdf0736ae3) --- src/volser/volprocs.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index bdf5ab1ef..1bbc1e438 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -2656,9 +2656,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; @@ -2695,8 +2693,6 @@ VolMonitor(struct rx_call *acid, transDebugEntries *transInfo) /*set pntr to right position */ } - TRELE(tt); - VTRANS_LOCK; } done: VTRANS_UNLOCK; -- 2.39.5