Tape drive out to lunch

Chris Torek chris at umcp-cs.UUCP
Fri Oct 11 13:48:22 AEST 1985


> ... Any "mt" commands met with:
>	/dev/rmt12: No such device or address

This generally happens when someone else has the drive open.  It
also occasionally happens when no one else has the drive open, but
the kernel believes otherwise.

I prefer kernels fixed so that "mt" says:

	/dev/rmt12: Mount device busy

While not perfect, this is unarguably better than "No such device
or address".

The required change is trivial.  Here is the one for the 4.2/4.3
TS11 driver.  Your line numbers will vary.

*** /tmp/,RCSt1005062	Thu Oct 10 23:46:25 1985
--- ts.c	Thu Oct  3 23:15:34 1985
***************
*** 180,185
  
  	tsunit = TSUNIT(dev);
! 	if (tsunit>=NTS || (sc = &ts_softc[tsunit])->sc_openf ||
! 	    (ui = tsdinfo[tsunit]) == 0 || ui->ui_alive == 0)
  		return (ENXIO);
  	if (tsinit(tsunit))

--- 196,200 -----
  
  	tsunit = TSUNIT(dev);
! 	if (tsunit >= NTS || (ui = tsdinfo[tsunit]) == 0 || ui->ui_alive == 0)
  		return (ENXIO);
  	sc = &ts_softc[tsunit];
***************
*** 183,186
  	    (ui = tsdinfo[tsunit]) == 0 || ui->ui_alive == 0)
  		return (ENXIO);
  	if (tsinit(tsunit))
  		return (ENXIO);

--- 198,204 -----
  	if (tsunit >= NTS || (ui = tsdinfo[tsunit]) == 0 || ui->ui_alive == 0)
  		return (ENXIO);
+ 	sc = &ts_softc[tsunit];
+ 	if (sc->sc_openf)
+ 		return (EBUSY);
  	if (tsinit(tsunit))
  		return (ENXIO);
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at mimsy.umd.edu



More information about the Comp.unix.wizards mailing list