2005-09-09 10:07:13

by Douglas Gilbert

[permalink] [raw]
Subject: [PATCH] permit READ DEFECT DATA in block/scsi_ioctl

The soon to be released smartmontools 5.34 uses the
READ DEFECT DATA command on SCSI disks. A disk that
has defect list entries (or worse, an increasing number
of them) is at risk.

Currently the first invocation of smartctl causes this:
scsi: unknown opcode 0x37
message to appear the console and in the log.

The READ DEFECT DATA SCSI command does not change
the state of a disk. Its opcode (0x37) is valid for
SBC devices (e.g. disks) and SMC-2 devices (media
changers) where it is called INITIALIZE STATUS ELEMENT
WITH RANGE and again doesn't change the external state
of the device.

The patch is against lk 2.6.13 .

Changelog:
- mark SCSI opcode 0x37 (READ DEFECT DATA) as
safe_for_read

Signed-off-by: Douglas Gilbert <[email protected]>

Doug Gilbert


Attachments:
scsi_ioctl2613rdd.diff (380.00 B)

2005-09-09 10:24:58

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH] permit READ DEFECT DATA in block/scsi_ioctl

On Fri, Sep 09 2005, Douglas Gilbert wrote:
> The soon to be released smartmontools 5.34 uses the
> READ DEFECT DATA command on SCSI disks. A disk that
> has defect list entries (or worse, an increasing number
> of them) is at risk.
>
> Currently the first invocation of smartctl causes this:
> scsi: unknown opcode 0x37
> message to appear the console and in the log.
>
> The READ DEFECT DATA SCSI command does not change
> the state of a disk. Its opcode (0x37) is valid for
> SBC devices (e.g. disks) and SMC-2 devices (media
> changers) where it is called INITIALIZE STATUS ELEMENT
> WITH RANGE and again doesn't change the external state
> of the device.
>
> The patch is against lk 2.6.13 .
>
> Changelog:
> - mark SCSI opcode 0x37 (READ DEFECT DATA) as
> safe_for_read
>
> Signed-off-by: Douglas Gilbert <[email protected]>

Fine with me.

Acked-by: Jens Axboe <[email protected]>

--
Jens Axboe