PERFORCE change 99224 for review
Scott Long
scottl at FreeBSD.org
Wed Jun 14 14:26:21 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=99224
Change 99224 by scottl at 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: {
More information about the p4-projects
mailing list