From owner-p4-projects@FreeBSD.ORG Wed Jun 14 14:26:21 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 544D516A835; Wed, 14 Jun 2006 14:26:21 +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 31E4B16A833 for ; Wed, 14 Jun 2006 14:26:21 +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 DB59343D48 for ; Wed, 14 Jun 2006 14:26:20 +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 k5EENvvJ000788 for ; Wed, 14 Jun 2006 14:23:57 GMT (envelope-from scottl@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5EENvtU000785 for perforce@freebsd.org; Wed, 14 Jun 2006 14:23:57 GMT (envelope-from scottl@freebsd.org) Date: Wed, 14 Jun 2006 14:23:57 GMT Message-Id: <200606141423.k5EENvtU000785@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 99224 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: Wed, 14 Jun 2006 14:26:21 -0000 http://perforce.freebsd.org/chv.cgi?CH=99224 Change 99224 by scottl@scottl-x64 on 2006/06/14 14:23:07 Expand the coverage of the SIM lock in xptioctl to protect xpt_path_free. Add a comment explaining why this is done. Affected files ... .. //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#37 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/cam/cam_xpt.c#37 (text+ko) ==== @@ -1016,6 +1016,12 @@ return(0); } +/* + * Don't automatically grab the xpt softc lock here even though this is going + * through the xpt device. The xpt device is really just a back door for + * accessing other devices and SIMs, so the right thing to do is to grab + * the appropriate SIM lock once the bus/SIM is located. + */ static int xptioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { @@ -1080,10 +1086,10 @@ xpt_merge_ccb(ccb, inccb); ccb->ccb_h.cbfcnp = xptdone; cam_periph_runccb(ccb, NULL, 0, 0, NULL); - CAM_SIM_UNLOCK(bus->sim); bcopy(ccb, inccb, sizeof(union ccb)); xpt_free_path(ccb->ccb_h.path); xpt_free_ccb(ccb); + CAM_SIM_UNLOCK(bus->sim); break; case XPT_DEBUG: {