Awatmath.1259
net.bugs.4bsd
utzoo!decvax!watmath!dmmartindale
Sun Dec 13 04:46:38 1981
Tape UNSAFE error

I suspect the problem with the TM11 UNSAFE is identical to the
same bug in the ht driver.  What happens is that the first open
attempt causes a SENSE operation to be done; this sets UNSAFE if
the drive is offline.  When the second open attempt is made, the
error bit is still sitting there but gets cleared in the process
of checking.  I fixed it by making sure a drive clear is done if
necessary.  Below are the changes I made in ht.c; it shouldn't be
too difficult to find the corresponding places in tm.c.
(this code may be more conservative than it needs to be)

htustart(mi)
       register struct mba_device *mi;
{
       register struct htdevice *htaddr =
           (struct htdevice *)mi->mi_drv;
       register struct buf *bp = mi->mi_tab.b_actf;
       register struct tu_softc *sc = &tu_softc[TUUNIT(bp->b_dev)];
       daddr_t blkno;
#ifdef FIX
       int sense = 0;
#endif FIX

       htaddr->httc = sc->sc_dens;
       if (bp == &chtbuf[HTUNIT(bp->b_dev)] && bp->b_command == HT_SENSE) {
               htaddr->htcs1 = HT_SENSE|HT_GO;
               mbclrattn(mi);
#ifdef FIX
               sense++;
#endif FIX
       }
       sc->sc_dsreg = htaddr->htds;
       sc->sc_erreg = htaddr->hter;
       sc->sc_resid = htaddr->htfc;
       sc->sc_flags &= ~(H_WRITTEN|H_REWIND);
       if ((htaddr->htdt & HTDT_SPR) == 0 || (htaddr->htds & HTDS_MOL) == 0)
               if (sc->sc_openf > 0)
                       sc->sc_openf = -1;
#ifdef FIX
       if (sense && (htaddr->htds&HTDS_ERR)!=0)
               htaddr->htcs1 = HT_DCLR|HT_GO;
#endif FIX
       if (sc->sc_openf b_flags |= B_ERROR;
               return (MBU_NEXT);
       }

-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <[email protected]>
of http://communication.ucsd.edu/A-News/


This Usenet Oldnews Archive
article may be copied and distributed freely, provided:

1. There is no money collected for the text(s) of the articles.

2. The following notice remains appended to each copy:

The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.