From owner-freebsd-hackers Tue Sep 2 12:12:49 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA21869 for hackers-outgoing; Tue, 2 Sep 1997 12:12:49 -0700 (PDT) Received: from iafnl.es.iaf.nl (uucp@iafnl.es.iaf.nl [195.108.17.20]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id MAA21858 for ; Tue, 2 Sep 1997 12:12:45 -0700 (PDT) Received: by iafnl.es.iaf.nl with UUCP id AA26889 (5.67b/IDA-1.5 for freebsd-hackers@FreeBSD.ORG); Tue, 2 Sep 1997 21:12:47 +0200 Received: (from wilko@localhost) by yedi.iaf.nl (8.8.5/8.6.12) id XAA02739; Mon, 1 Sep 1997 23:26:37 +0200 (MET DST) From: Wilko Bulte Message-Id: <199709012126.XAA02739@yedi.iaf.nl> Subject: Re: Patch for small annoyance in st driver To: jmattson@wco.com (Jim Mattson) Date: Mon, 1 Sep 1997 23:26:37 +0200 (MET DST) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: <199709011918.MAA00247@denali.campbell.ca.us> from "Jim Mattson" at Sep 1, 97 12:17:59 pm X-Organisation: Private FreeBSD site - Arnhem, The Netherlands X-Pgp-Info: PGP public key at 'finger wilko@freefall.freebsd.org' X-Mailer: ELM [version 2.4 PL24 ME8a] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Jim Mattson wrote... > With 2.2.2-RELEASE, I get the following error on every open of my tape > device: > > st0(ahc0:4:0): ILLEGAL REQUEST asc:20,0 Invalid command operation code Whether this happens depends on the device at hand. Some devices (the smarter ones) simply accept and ignore the command when they cannot act on the PREVENT MEDIUM REMOVAL (think it's called that). > > I've tracked this down to the call to scsi_prevent() in st_open(). > Given the pre-existing comment, the following change seems justified. > (Oh, and it gets rid of the annoying message too!) > > *** st.c 1997/09/01 18:39:49 1.1 > --- st.c 1997/09/01 18:58:17 > *************** > *** 433,439 **** > if ((flags & O_ACCMODE) == FWRITE) > st->flags |= ST_WRITTEN; > > ! scsi_prevent(sc_link, PR_PREVENT, 0); /* who cares if it fails? */ > > SC_DEBUG(sc_link, SDEV_DB2, ("Open complete\n")); > > --- 433,439 ---- > if ((flags & O_ACCMODE) == FWRITE) > st->flags |= ST_WRITTEN; > > ! scsi_prevent(sc_link, PR_PREVENT, SCSI_SILENT | SCSI_ERR_OK); /* who cares if it fails? */ > > SC_DEBUG(sc_link, SDEV_DB2, ("Open complete\n")); Looks OK in my humble view. _ ____________________________________________________________________ | / o / / _ Bulte email: wilko@yedi.iaf.nl http://www.tcja.nl/~wilko |/|/ / / /( (_) Arnhem, The Netherlands - Do, or do not. There is no 'try' ----------------------------------------------------------------------Yoda