Re: SCSI Tape driver

Richard B. Johnson (root@chaos.analogic.com)
Tue, 16 Sep 1997 09:52:49 -0400 (EDT)


On Tue, 16 Sep 1997, Ricky Beam wrote:

> Letting the chips fall where they may, I quote Sameer Anja:
> >yes...I have seen a similar thing happening here too with my tape.
> >-Sameer
> ...
> >On Mon, 15 Sep 1997, Richard B. Johnson wrote:
> >> Date: Mon, 15 Sep 1997 10:33:34 -0400 (EDT)
> >> From: Richard B. Johnson <root@chaos.analogic.com>
> >> To: Linux kernel <linux-kernel@vger.rutgers.edu>
> >> Subject: SCSI Tape driver
> ...
> >> Sep 15 10:10:32 chaos kernel: st0: Error with sense data:
> >> Current error st09:00: sns = f0 3
> >> Sep 15 10:10:32 chaos kernel: ASC=31 ASCQ= 0
> >> Sep 15 10:10:32 chaos kernel: Raw sense data:
> >> 0xf0 0x00 0x03 0x00 0x00 0x02 0xec 0x0a 0x00 0x00
> >> 0x00 0x00 0x31 0x00 0x00 0x00
>
> Consulting the SCSI2 standard, the drive has signaled a medium error further
> specifying that the medium format is corrupted:
>
> Sense key: 03h
> Table 69 - Sense key (0h-7h) descriptions
> +========-====================================================================+
> | 3h | MEDIUM ERROR. Indicates that the command terminated with a non- |
> | | recovered error condition that was probably caused by a flaw in |
> | | the medium or an error in the recorded data. This sense key may |
> | | also be returned if the target is unable to distinguish between a |
> | | flaw in the medium and a specific hardware failure (sense key 4h).|
> +========-====================================================================+
>
> ASC: 31h ASCQ: 00h
> Table D.1 - ASC and ASCQ assignments
> +=============================================================================+
> | ASC ASCQ DTLPWRSOMC DESCRIPTION |
> | --- ---- ----------------------------------------------------- |
> | 31 00 DT W O MEDIUM FORMAT CORRUPTED |
> +=============================================================================+
>
> It is perfectly valid for the driver to remember this until it is informed
> that the tape has changed (unit attention). I hope that helps...
>

After this error, the tape user, i.e., tar, etc., has closed the fd. There
isn't anybody accessing the tape anymore. Who would the "Unit attention"
go to?

The tape gets changed. Open has still not got called because nobody
is accessing the tape. Therefore nobody "knows" that the tape has been
changed, even though the drive "remembers".

Several hours/days/months later, open is called by a new tape user.
Is this user going to get errors reported during a previous tape
session? Or is this user going to get a Unit attention "error" when,
in fact, no error for a completely new session, with a completely new
tape, has occurred.

I think that a tape can only be "changed", while a fd is open. Whatever
happens when the tape-drive is not in-use, i.e., physically changing the
media, etc., should (logically) be ignored. In other words, a new open
should do whatever is neccessary to remove all previous history of the
drive's use.

A cursory glance at the code seems to show that this is what was
intended. However, the sense-key call, which already ignores some
"errorious residue" probably should ignore something more in addition.

Cheers,
DJ
Richard B. Johnson
Analogic Corporation
Penguin : Linux version 2.1.54 on an i586 machine (66.15 BogoMips).
Warning : It's hard to stay on the trailing edge of technology.
Linux : Engineering tool
Windows : Child's computer interface written in BASIC.
Win-NT : Child's computer interface rewritten in C.