Subject: Re: Interpreting sense codes for scsi-tapes
To: None <tech-kern@NetBSD.ORG>
From: Leo Weppelman <leo@ahwau.ahold.nl>
List: tech-kern
Date: 08/18/1995 21:10:13
> 
> I have a problem with the scsi-tapedriver. The story is this:
> 
> When you issue a command like:
> 	dd if=/dev/zero of=/dev/rst0 bs=1k count=10
> and you read it back with:
> 	dd if=/dev/rst0 of=/dev/null bs=1k
> 
> You will get 11 blocks back. I have turned on some tracing in my (atari)
> driver, and what I see is, that the read command fails on the 11th block
> with residual count (xs->resid) 1024, xs->error = XS_SENSE. The sense data
> returned is: 0xf0 0x00 0x80 0x00 0x00 0x00 etc.

Sigh, I solved it. It was a typo in the scsi-driver... I determined the
number of sense-bytes to read by: sizeof(struct scsi_sense) instead of
sizeof(struct scsi_sense_data) . I have read over this _many_ times.
Sometimes it seems that trying to code something cleanly hides bugs...

Leo.