Skip to contentSkip to conversation

SCSI Tape hangs when no tape loaded (2.5.6x)

DISCUSSION Ruud Linders 2 participants 2 messages Feb 16, 2003

lore
Share & tools
lore
#0 lore raw

On both 2.5.60 and 2.5.61 when there is no tape loaded in my SCSI DAT tape drive, access to the drive blocks for exactly 2 minutes before timing out and giving an I/O error.

# mt stat
....... < 2 minutes later > ...
/dev/tape: Input/output error

< me putting a tape in the unit>

# mt stat
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x25 (DDS-3).
Soft error count since last status=0
General status bits on (45010000):
 BOT WR_PROT ONLINE IM_REP_EN

I don't remember seeing this on earlier 2.5.5[0-3] or so kernels, looks like a bug in the SCSI layer.

Output from dmesg (2.5.61):

SCSI subsystem driver Revision: 1.00
scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.8
<Adaptec 2940A Ultra SCSI adapter>
aic7860: Ultra Single Channel A, SCSI Id=7, 3/253 SCBs

  Vendor: HP        Model: C1537A            Rev: L105
  Type:   Sequential-Access                  ANSI SCSI revision: 02
  Vendor: PLEXTOR   Model: CD-ROM PX-20TS    Rev: 1.02
  Type:   CD-ROM                             ANSI SCSI revision: 02
  Vendor: TOSHIBA   Model: DVD-ROM SD-M1201  Rev: 1R08
  Type:   CD-ROM                             ANSI SCSI revision: 02
  Vendor: YAMAHA    Model: CRW8424S          Rev: 1.0j
  Type:   CD-ROM                             ANSI SCSI revision: 02

st: Version 20020805, bufsize 32768, wrt 30720, max init. bufs 4, s/g segs 16 Attached scsi tape st0 at scsi0, channel 0, id 2, lun 0
Attached scsi CD-ROM sr0 at scsi0, channel 0, id 3, lun 0 Attached scsi CD-ROM sr1 at scsi0, channel 0, id 5, lun 0 Attached scsi CD-ROM sr2 at scsi0, channel 0, id 6, lun 0 (scsi0:A:3): 10.000MB/s transfers (10.000MHz, offset 15)
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.12
(scsi0:A:5): 20.000MB/s transfers (20.000MHz, offset 15)
sr1: scsi3-mmc drive: 32x/32x cd/rw xa/form2 cdda tray (scsi0:A:6): 20.000MB/s transfers (20.000MHz, offset 15)
sr2: scsi3-mmc drive: 24x/16x writer cd/rw xa/form2 cdda tray

--
Ruud Linders

#1 lore raw
Quoted 10 lines · Ruud Linders

On both 2.5.60 and 2.5.61 when there is no tape loaded in my SCSI DAT tape drive, access to the drive blocks for exactly 2 minutes before timing out and giving an I/O error.

# mt stat
....... < 2 minutes later > ...
/dev/tape: Input/output error

Does you mt open the tape device with the O_NONBLOCK option? If not, this is what is expected. mt-st version >= 0.6 does use this option. I don't know about other mt's.

The open() behaviour of st was changed at 2.5.3 to conform with SUS (blocking) and what the other Unices do (timeout). If the device is opened without O_NONBLOCK, the driver waits for some time (default 2 minutes) for the device to become ready. If it does not become ready, an error is returned.

Kai

P.S. I just tested 2.5.61 and in my system 'mt status' without tape in the drive works as expected (i.e., prints status immediately).