From owner-p4-projects@FreeBSD.ORG Thu Nov 30 23:02:59 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 39E4E16A47B; Thu, 30 Nov 2006 23:02:59 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7ED016A403; Thu, 30 Nov 2006 23:02:58 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3A5C43CA6; Thu, 30 Nov 2006 23:02:47 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.14] (imini.samsco.home [192.168.254.14]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id kAUN2pQm082151; Thu, 30 Nov 2006 16:02:56 -0700 (MST) (envelope-from scottl@samsco.org) Message-ID: <456F631B.3020100@samsco.org> Date: Thu, 30 Nov 2006 16:02:51 -0700 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.7) Gecko/20050416 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <200611290826.kAT8Qf13036044@repoman.freebsd.org> <20061130222945.GB28271@garage.freebsd.pl> In-Reply-To: <20061130222945.GB28271@garage.freebsd.pl> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.1.1 X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on pooker.samsco.org Cc: Perforce Change Reviews Subject: Re: PERFORCE change 110667 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Nov 2006 23:02:59 -0000 Pawel Jakub Dawidek wrote: > 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? > Good catch, thanks! Scott