From owner-p4-projects@FreeBSD.ORG Tue Jun 13 05:06:27 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 3D0AF16A41F; Tue, 13 Jun 2006 05:06:27 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ED59A16A418 for ; Tue, 13 Jun 2006 05:06:26 +0000 (UTC) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB02943D46 for ; Tue, 13 Jun 2006 05:06:26 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5D5491M078262 for ; Tue, 13 Jun 2006 05:04:09 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5D549NR078259 for perforce@freebsd.org; Tue, 13 Jun 2006 05:04:09 GMT (envelope-from scottl@freebsd.org) Date: Tue, 13 Jun 2006 05:04:09 GMT Message-Id: <200606130504.k5D549NR078259@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to scottl@freebsd.org using -f From: Scott Long To: Perforce Change Reviews Cc: Subject: PERFORCE change 99121 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: Tue, 13 Jun 2006 05:06:27 -0000 http://perforce.freebsd.org/chv.cgi?CH=99121 Change 99121 by scottl@scottl-x64 on 2006/06/13 05:03:40 Fix a brain-o with INVARIANTS. The ccb typically gets freed in the periph callback in the camisr, so it can't be deferenced again to get to the mutex pointer. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#36 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#36 (text+ko) ==== @@ -7182,6 +7182,7 @@ cam_isrq_t queue; int s; struct ccb_hdr *ccb_h; + struct cam_sim *sim; /* * Transfer the ccb_bioq list to a temporary list so we can operate @@ -7198,7 +7199,8 @@ int runq; TAILQ_REMOVE(&queue, ccb_h, sim_links.tqe); - mtx_lock(ccb_h->path->bus->sim->mtx); + sim = ccb_h->path->bus->sim; + mtx_lock(sim->mtx); ccb_h->pinfo.index = CAM_UNQUEUED_INDEX; splx(s); @@ -7288,7 +7290,7 @@ (*ccb_h->cbfcnp)(ccb_h->path->periph, (union ccb *)ccb_h); /* Raise IPL for while test */ - mtx_unlock(ccb_h->path->bus->sim->mtx); + mtx_unlock(sim->mtx); s = splcam(); } splx(s);