PERFORCE change 99121 for review

Scott Long scottl at FreeBSD.org
Tue Jun 13 05:06:27 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=99121

Change 99121 by scottl at 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);


More information about the p4-projects mailing list