Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Aug 1996 18:10:39 -0700 (PDT)
From:      pusateri@jnx.com
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        pst@jnx.com
Subject:   kern/1545: SCSI tapes don't unload properly (bogus PREVENT_MEDIA_REMOVAL)
Message-ID:  <199608280110.SAA10352@base.jnx.com>
Resent-Message-ID: <199608280120.SAA13382@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608280110.SAA10352>