From owner-freebsd-bugs Tue Aug 27 18:20:04 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id SAA13394 for bugs-outgoing; Tue, 27 Aug 1996 18:20:04 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id SAA13382; Tue, 27 Aug 1996 18:20:02 -0700 (PDT) Resent-Date: Tue, 27 Aug 1996 18:20:02 -0700 (PDT) Resent-Message-Id: <199608280120.SAA13382@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, Received:"from red.jnx.com (ppp-206-170-2-23.sntc01.pacbell.net [206.170.2.23]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id SAA12745 for" ; Tue, 27 Aug 1996 18:10:46.-0700 (PDT) Received: from base.jnx.com (base.jnx.com [208.197.169.238]) by red.jnx.com (8.7.5/8.7.3) with ESMTP id SAA11565; Tue, 27 Aug 1996 18:10:43 -0700 (PDT) Received: (from pst@localhost) by base.jnx.com (8.7.5/8.7.3) id SAA10352; Tue, 27 Aug 1996 18:10:39 -0700 (PDT) Message-Id: <199608280110.SAA10352@base.jnx.com> Date: Tue, 27 Aug 1996 18:10:39 -0700 (PDT) From: pusateri@jnx.com To: FreeBSD-gnats-submit@freebsd.org Cc: pst@jnx.com X-Send-Pr-Version: 3.2 Subject: kern/1545: SCSI tapes don't unload properly (bogus PREVENT_MEDIA_REMOVAL) Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1545 >Category: kern >Synopsis: SCSI tapes don't unload properly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 27 18:20:01 PDT 1996 >Last-Modified: >Originator: Tom Pusateri >Organization: Juniper Networks >Release: FreeBSD 2.2-CURRENT i386 >Environment: -current as of 27 Aug 1996. >Description: When I would do a "mt offline" command or use the /dev/erst* devices, the tape would unload but not eject as I expected. Looking at the HP documentation, it says that if a PREVENT_MEDIA_REMOVAL command has been issued, then this will happen. After looking at the kernel, it looks like st.c does issue this command and erroneously reverses it after sending the UNLOAD command. >How-To-Repeat: See description. >Fix: *** st.c.orig Mon Apr 1 23:54:26 1996 --- st.c Mon Aug 26 17:32:06 1996 *************** *** 496,501 **** --- 496,504 ---- if ((st->flags & (ST_WRITTEN | ST_FM_WRITTEN)) == ST_WRITTEN) st_write_filemarks(unit, 1, 0); + + scsi_prevent(sc_link, PR_ALLOW, SCSI_SILENT); + switch (mode & 0x3) { case 0: case 3: /* for now */ *************** *** 510,516 **** st_unmount(unit, EJECT); break; } - scsi_prevent(sc_link, PR_ALLOW, SCSI_SILENT); sc_link->flags &= ~SDEV_OPEN; st->flags &= ~ST_OPEN; --- 513,518 ---- *************** *** 1111,1116 **** --- 1113,1119 ---- flags); break; case MTOFFL: /* rewind and put the drive offline */ + scsi_prevent(sc_link, PR_ALLOW, SCSI_SILENT); st_unmount(unit, EJECT); break; case MTNOP: /* no operation, sets status only */ >Audit-Trail: >Unformatted: