Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Apr 1999 08:57:06 -0700 (PWT)
From:      Matthew Jacob <mjacob@feral.com>
To:        Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>, Juergen Lock <nox@jelal.kn-bremen.de>
Cc:        freebsd-scsi@FreeBSD.ORG
Subject:   Re: QIC tape problems on -stable (was: hanging `tar xfvR /dev/nrst0' process, can i debug it?)
Message-ID:  <Pine.LNX.4.04.9904280852520.24720-100000@feral.com>
In-Reply-To: <Pine.LNX.4.04.9904280824090.24720-100000@feral.com>

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


> These are *amazingly* broken drives then. The SCSI specification says that
> a write of *zero* filemarks is to flush any pending writes. You have to do
> this when you do a read hardware position in order to avoid an ambiguity
> in the spec as to the true position as affected by data in the tape drive
> buffer. This is not an abstruse edge case in the SCSI spec. This is common
> sense as well. I believe that the writers of QIC f/w should be sent to
> Redmond for the rest of their miserable lives.
> 

That said, try this patch:

*** scsi_sa.c.prev	Wed Apr 28 08:54:12 1999
--- scsi_sa.c	Wed Apr 28 08:56:43 1999
***************
*** 2723,2735 ****
  {
  	struct scsi_tape_position_data loc;
  	union ccb *ccb;
! 	struct sa_softc *softc;
! 	int error;
  
  	/*
! 	 * First flush any pending writes...
  	 */
! 	error = sawritefilemarks(periph, 0, 0);
  
  	/*
  	 * The latter case is for 'write protected' tapes
--- 2723,2738 ----
  {
  	struct scsi_tape_position_data loc;
  	union ccb *ccb;
! 	struct sa_softc *softc = (struct sa_softc *)periph->softc;
! 	int error = 0;
  
  	/*
! 	 * First flush any pending writes (if any had occurred).
! 	 * Amazingly stupid drives sometimes take a zero count
! 	 * and say "Duh! Zero must mean One!".
  	 */
! 	if (softc->flags & SA_FLAG_TAPE_WRITTEN)
! 		error = sawritefilemarks(periph, 0, 0);
  
  	/*
  	 * The latter case is for 'write protected' tapes
***************
*** 2739,2745 ****
  	if (error != 0 && error != EACCES)
  		return (error);
  
- 	softc = (struct sa_softc *)periph->softc;
  	ccb = cam_periph_getccb(periph, 1);
  
  	scsi_read_position(&ccb->csio, 1, sadone, MSG_SIMPLE_Q_TAG,
--- 2742,2747 ----



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.04.9904280852520.24720-100000>