Subject: Re: scsi disks with "Medium Format Corrupted"
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 05/19/2004 14:14:48
--zCKi3GIZzVBPywwA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, May 19, 2004 at 05:15:47PM +0200, Manuel Bouyer wrote:
> Hi,
> as part of tests with esiop I managed to damage a scsi disk with the form=
at
> command. It's now in this state:
> java:/root#scsictl /dev/rsd1c format 516
> scsictl: /dev/rsd1c: Device not configured
>=20
> And on console:
> sd1(esiop0:0:3:0):  Check Condition on CDB: 0x23 00 00 00 00 00 00 00 0c =
00
>     SENSE KEY:  Media Error
>      ASC/ASCQ:  Medium Format Corrupted
>      FRU CODE:  0xc
>=20
> The problem is that we allow opening disks which are not formatted at all,
> or with a format we can't handle, but we don't handle the case where
> READ_FORMAT_CAPACITIES fails.

Just to make sure I understand, since READ_FORMAT_CAPACITIES fails, we=20
don't permit the open and thus can't format the device. Your change would=
=20
let us open the device, permitting the format. Correct?

> The attached patch cause sd_interpret_sense() to return EFTYPE instead of
> EIO for the "Medium Format Corrupted" ASC/ASQ, so that we can check for
> this kind of event in sd_get_capacity().
> We also should not try to build a disklabel if the media is not formatted
> (in my case this caused a panic: buf mem pool index 54, because sd->params
> is not initialised properly).
>=20
> Any comments ?

Assuming I understood correctly above, looks good.

Take care,

Bill

--zCKi3GIZzVBPywwA
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFAq85IWz+3JHUci9cRAuhbAJ9EB9KDm9xI0aMq8iiO0NPbi/TFVACdE4MU
fXHcF3ttcKwWsmcinGPEc1k=
=IfH2
-----END PGP SIGNATURE-----

--zCKi3GIZzVBPywwA--