From: krw Date: Tue, 3 Aug 2010 19:37:17 +0000 (+0000) Subject: Don't attempt to set the read or write caches on usb disks. It X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cece5972e9630ff2dbf6fe33c5edd6c5a05c0e53;p=openbsd Don't attempt to set the read or write caches on usb disks. It breaks at least one previously working device, as discovered by naddy@. dlg@ confirmed other kernels also avoid attempting this operation on usb disks. ok dlg@ deraadt@ --- diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 98a44ad2dc2..29db37f9585 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.204 2010/07/07 03:53:07 marco Exp $ */ +/* $OpenBSD: sd.c,v 1.205 2010/08/03 19:37:17 krw Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -1040,6 +1040,9 @@ sd_ioctl_cache(struct sd_softc *sc, long cmd, struct dk_cache *dkc) int big; int rv; + if (ISSET(sc->sc_link->flags, SDEV_UMASS)) + return (EOPNOTSUPP); + /* see if the adapter has special handling */ rv = scsi_do_ioctl(sc->sc_link, cmd, (caddr_t)dkc, 0); if (rv != ENOTTY) {