]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
[SCSI] permit READ DEFECT DATA in block/scsi_ioctl
authorDouglas Gilbert <dougg@torque.net>
Fri, 9 Sep 2005 10:07:32 +0000 (20:07 +1000)
committerJames Bottomley <jejb@mulgrave.(none)>
Fri, 9 Sep 2005 21:42:44 +0000 (16:42 -0500)
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.

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

Signed-off-by: Douglas Gilbert <dougg@torque.net>
Acked-by: Jens Axboe <axboe@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/block/scsi_ioctl.c

index abb2df249fd35dbb3242d31285f75586022ab324..856c2278e9d0b74ea1a8a168be4743f859505a99 100644 (file)
@@ -123,6 +123,7 @@ static int verify_command(struct file *file, unsigned char *cmd)
                safe_for_read(READ_12),
                safe_for_read(READ_16),
                safe_for_read(READ_BUFFER),
+               safe_for_read(READ_DEFECT_DATA),
                safe_for_read(READ_LONG),
                safe_for_read(INQUIRY),
                safe_for_read(MODE_SENSE),