[2342] in linux-scsi channel archive
Re: "read defect list" with 2.0.30-pre7 and patch Aug19
daemon@ATHENA.MIT.EDU (Gerard Roudier)
Mon Aug 25 10:55:56 1997
Date: Mon, 25 Aug 1997 16:50:04 +0200 (MET DST)
From: Gerard Roudier <groudier@club-internet.fr>
To: Ulrich Windl <ulrich.windl@rz.uni-regensburg.de>
cc: Doug Ledford <dledford@dialnet.net>, linux-scsi@vger.rutgers.edu
In-Reply-To: <62BB3D8755E@rkdvmks1.ngate.uni-regensburg.de>
On Mon, 25 Aug 1997, Ulrich Windl wrote:
> On 25 Aug 97 at 10:20, Gerard Roudier wrote:
>
[ ... ]
> > Large defect lists are not uncommon nowadays with large capacity disks.
> > The current linux scsi ioctl and generic code must should be stated as
> > 'not useable' for getting defect lists in my opinion.
> The original intention WHY I wanted to read the defect list is to
> check for grown defects. HP does this in an automated job every
> night, and we had a really bad series of ST15150W (8 of 16 disks
> replaced within one year).
Defect list read allocation length is 2 bytes, so < 65535.
That means that you should have more chance to succeed using the sg driver
that allows a global BIG BUFFER to be used.
However, if you just need to know the actual size of a defect list, you
just have to use an allocation length that will result as less than 1 PAGE
of data being returned.
In fact only reading 4 bytes is enough to get the actual size of a defect
list in bytes 2 (MSB) and 3 (LSB) of the data returned by the device.
('scsi_ioctl' should be quite usable for reading 4 bytes).
(This is described is some implementation notes of SCSI-2 specs)
(I assume that the device adhere to scsi-2 specs and so, it will not
terminate the command with check condition when the input buffer is too
small for the whole defect list data).
Gerard.