[net.bugs.4bsd] TU-78 will go off the end of the tape

malloy@ittral.UUCP (William P. Malloy) (06/10/85)

Index: sys/vaxmba/mt.c 4.2BSD

First line: /*	mt.c	6.1	83/07/29	*/

Description:
	When writing on a TU-78 tape drive you can go right off the end of tape.
	In particular if you tell it to write a large block (say 10K) it
	will attempt to write it, get an EOT interrupt in the data handling
	interrupt routine and return to the MBA driver with the value DONE.
	The MBA then tries the non-data interrupt routine, which also finds
	the EOT but returns the value RETRY.  The system keeps retrying to look
	at the TU-78 (moving the tape a little each time) until the tape is off
	the reel.

Repeat-By:
	Do your incremental dumps to disk at night like we do.  Then `dd' the
	files onto the tape in the morning.  When the dumps get large enough
	you need more then one tape to fit them all, but instead of stopping
	it just goes right off the end of the tape.  Confusing the MIS folks
	who do our backups no end.

Fix:	The simple method (which solves the problem with minimum change) is to
	change the return value to DONE.  If someone could explain to me why
	it should be RETRY (I'm sure there is a good reason), I'd like to know.
	For us this solves the problem and makes our dumps work, and as that's
	the only thing we use our tape drives for it's fine with us.  I'm
	surprised no one else has ever noticed this problem before.  I suppose
	because most people use dump on a TU-78, and it guesses the tape length
	and seems not to use EOT markers at all.

*** mt.c.orig
--- mt.c
***************
*** 408,421
	case MTER_TM:
	case MTER_EOT:
	case MTER_LEOT:
		if (sc->sc_blkno > bdbtofsb(bp->b_blkno)) {
			sc->sc_nxrec = bdbtofsb(bp->b_blkno) + fc;
			sc->sc_blkno = sc->sc_nxrec;
		} else {
  			sc->sc_blkno = bdbtofsb(bp->b_blkno) - fc;
  			sc->sc_nxrec = sc->sc_blkno - 1;
  		}
! 		return (MBN_RETRY);
  
  	case MTER_FPT:
  		printf("mu%d: no write ring\n", MUUNIT(bp->b_dev));

--- 411,424 -----
	case MTER_TM:
	case MTER_EOT:
	case MTER_LEOT:
		if (sc->sc_blkno > bdbtofsb(bp->b_blkno)) {
			sc->sc_nxrec = bdbtofsb(bp->b_blkno) + fc;
			sc->sc_blkno = sc->sc_nxrec;
		} else {
  			sc->sc_blkno = bdbtofsb(bp->b_blkno) - fc;
  			sc->sc_nxrec = sc->sc_blkno - 1;
  		}
! 		return (MBN_DONE);
  
  	case MTER_FPT:
  		printf("mu%d: no write ring\n", MUUNIT(bp->b_dev));
-- 
Address: William P. Malloy, ITT Telecom, B & CC Engineering Group, Raleigh NC
         {ihnp4!mcnc, burl, ncsu, decvax!ittvax}!ittral!malloy