Subject: Re: scsi disks with "Medium Format Corrupted"
To: Manuel Bouyer <>
From: Bill Studenmund <>
List: tech-kern
Date: 05/19/2004 14:14:48
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=
> command. It's now in this state:
> java:/root#scsictl /dev/rsd1c format 516
> scsictl: /dev/rsd1c: Device not configured
> And on console:
> sd1(esiop0:0:3:0):  Check Condition on CDB: 0x23 00 00 00 00 00 00 00 0c =
>     SENSE KEY:  Media Error
>      ASC/ASCQ:  Medium Format Corrupted
>      FRU CODE:  0xc
> 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

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=
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).
> Any comments ?

Assuming I understood correctly above, looks good.

Take care,


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

Version: GnuPG v1.2.3 (NetBSD)