]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
volmonitor keep vtrans lock
authorDan Hyde <drh@umich.edu>
Wed, 13 Jan 2010 19:38:47 +0000 (14:38 -0500)
committerRuss Allbery <rra@debian.org>
Fri, 26 Mar 2010 19:27:45 +0000 (12:27 -0700)
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 <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d4f6ece19b05f2233e53f2d3c59f92316ec5ec3a)
Change-Id: Ic12bb6687a9c34e85abc2023c02264de6ae27614
Reviewed-on: http://gerrit.openafs.org/1588
Reviewed-by: Dan Hyde <drh@umich.edu>
Tested-by: Dan Hyde <drh@umich.edu>
(cherry picked from commit 190ef2cb29577f2fcf1853149cf210fdf0736ae3)

src/volser/volprocs.c

index bdf5ab1efb931023deae1c0ede898c3bf4c5b28b..1bbc1e438a9bd5d96cd01255b46a688a3f4b910a 100644 (file)
@@ -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;