From owner-freebsd-scsi Wed Apr 28 8:58: 3 1999 Delivered-To: freebsd-scsi@freebsd.org Received: from feral.com (feral.com [192.67.166.1]) by hub.freebsd.org (Postfix) with ESMTP id 51945154CF for ; Wed, 28 Apr 1999 08:57:57 -0700 (PDT) (envelope-from mjacob@feral.com) Received: from feral.com (mjacob@feral.com [192.67.166.1]) by feral.com (8.8.7/8.8.7) with ESMTP id IAA25039; Wed, 28 Apr 1999 08:57:07 -0700 Date: Wed, 28 Apr 1999 08:57:06 -0700 (PWT) From: Matthew Jacob Reply-To: mjacob@feral.com To: Joerg Wunsch , Juergen Lock Cc: freebsd-scsi@FreeBSD.ORG Subject: Re: QIC tape problems on -stable (was: hanging `tar xfvR /dev/nrst0' process, can i debug it?) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > 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