Mon Apr 25 14:14:22 2011 UTC ()
Don't kill outstanding requests when detaching a scsibus on shutdown.
Both the controller and tyhe targets are still running.


(hannken)
diff -r1.260 -r1.261 src/sys/dev/scsipi/scsiconf.c

cvs diff -r1.260 -r1.261 src/sys/dev/scsipi/scsiconf.c (expand / switch to context diff)
--- src/sys/dev/scsipi/scsiconf.c 2011/04/18 01:47:28 1.260
+++ src/sys/dev/scsipi/scsiconf.c 2011/04/25 14:14:22 1.261
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsiconf.c,v 1.260 2011/04/18 01:47:28 rmind Exp $	*/
+/*	$NetBSD: scsiconf.c,v 1.261 2011/04/25 14:14:22 hannken Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.260 2011/04/18 01:47:28 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.261 2011/04/25 14:14:22 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -269,6 +269,8 @@
 			periph = scsipi_lookup_periph(chan, ctarget, clun);
 			if (periph == NULL)
 				continue;
+			if ((flags & DETACH_SHUTDOWN) != 0)
+				return EBUSY;
 			TAILQ_FOREACH(xs, &periph->periph_xferq, device_q) {
 				callout_stop(&xs->xs_callout);
 				xs->error = XS_DRIVER_STUFFUP;