Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Nov 2006 23:29:45 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Scott Long <scottl@FreeBSD.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 110667 for review
Message-ID:  <20061130222945.GB28271@garage.freebsd.pl>
In-Reply-To: <200611290826.kAT8Qf13036044@repoman.freebsd.org>
References:  <200611290826.kAT8Qf13036044@repoman.freebsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Wed, Nov 29, 2006 at 08:26:41AM +0000, Scott Long wrote:
> http://perforce.freebsd.org/chv.cgi?CH=110667
> 
> Change 110667 by scottl@scottl-x64 on 2006/11/29 08:26:07
> 
> 	When traversing buses and devices, grab the sim lock at the highest
> 	point, i.e. xptbustraverse(), instead of doing it in disjointed ways
> 	in the lower layers.  One side effect of this is that async callbacks
> 	will be called with the sim/bus lock held already.  Another side
> 	effect is that pass device enumeration that originated in
> 	xpt_finishedconfig() is now decoupled into a taskqueue.
> 
> Affected files ...
> 
> .. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#45 edit
> .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_da.c#17 edit
> .. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_pass.c#14 edit
> 
> Differences ...
> 
> ==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#45 (text+ko) ====
> 
> @@ -2684,9 +2684,11 @@
>  		next_bus = TAILQ_NEXT(bus, links);
>  
>  		mtx_unlock(&xsoftc.xpt_lock);
> +		mtx_lock(bus->sim->mtx);
>  		retval = tr_func(bus, arg);
>  		if (retval == 0)
>  			return(retval);
> +		mtx_unlock(bus->sim->mtx);

Don't you leak a lock here on return?

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (FreeBSD)

iD8DBQFFb1tZForvXbEpPzQRAtBIAKDNEWYuGytl/YfhxvbS6WEUK7lu6QCfdrUi
7eP410avTfg14XMvByhecOE=
=TaXE
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061130222945.GB28271>