diff options
-rw-r--r-- | drivers/scsi/sr.c | 8 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index ba9c3e0387ce..b811dd0eb240 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c | |||
@@ -862,10 +862,16 @@ static void get_capabilities(struct scsi_cd *cd) | |||
862 | static int sr_packet(struct cdrom_device_info *cdi, | 862 | static int sr_packet(struct cdrom_device_info *cdi, |
863 | struct packet_command *cgc) | 863 | struct packet_command *cgc) |
864 | { | 864 | { |
865 | struct scsi_cd *cd = cdi->handle; | ||
866 | struct scsi_device *sdev = cd->device; | ||
867 | |||
868 | if (cgc->cmd[0] == GPCMD_READ_DISC_INFO && sdev->no_read_disc_info) | ||
869 | return -EDRIVE_CANT_DO_THIS; | ||
870 | |||
865 | if (cgc->timeout <= 0) | 871 | if (cgc->timeout <= 0) |
866 | cgc->timeout = IOCTL_TIMEOUT; | 872 | cgc->timeout = IOCTL_TIMEOUT; |
867 | 873 | ||
868 | sr_do_ioctl(cdi->handle, cgc); | 874 | sr_do_ioctl(cd, cgc); |
869 | 875 | ||
870 | return cgc->stat; | 876 | return cgc->stat; |
871 | } | 877 | } |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 50cb34ffef11..e8c2433ad8a8 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -148,6 +148,7 @@ struct scsi_device { | |||
148 | unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ | 148 | unsigned retry_hwerror:1; /* Retry HARDWARE_ERROR */ |
149 | unsigned last_sector_bug:1; /* do not use multisector accesses on | 149 | unsigned last_sector_bug:1; /* do not use multisector accesses on |
150 | SD_LAST_BUGGY_SECTORS */ | 150 | SD_LAST_BUGGY_SECTORS */ |
151 | unsigned no_read_disc_info:1; /* Avoid READ_DISC_INFO cmds */ | ||
151 | unsigned is_visible:1; /* is the device visible in sysfs */ | 152 | unsigned is_visible:1; /* is the device visible in sysfs */ |
152 | 153 | ||
153 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ | 154 | DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ |