aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-scsi.c
diff options
context:
space:
mode:
authorTony Battersby <tonyb@cybernetics.com>2005-12-21 16:35:44 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-12-24 10:02:24 -0500
commitfd71da468dd8897fe3f565dfd3743a87d8678e3a (patch)
tree77be514289e8d2cd897ff35ce02f5ee59e646bc7 /drivers/scsi/libata-scsi.c
parentdf7addbb45874f0f992266003155de5a22e1872f (diff)
[PATCH] fix libata inquiry VPD for ATAPI devices
The following patch prevents libata from incorrectly modifying inquiry VPD pages and command support data from ATAPI devices. I have tested the patch with a SATA ATAPI tape drive on an AHCI controller. Patch is against kernel 2.4.32 with 2.4.32-libata1.patch applied. Anthony J. Battersby Cybernetics Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r--drivers/scsi/libata-scsi.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 72ddba98f8fb..2282c04fee46 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -2044,7 +2044,7 @@ static int atapi_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask)
2044 else { 2044 else {
2045 u8 *scsicmd = cmd->cmnd; 2045 u8 *scsicmd = cmd->cmnd;
2046 2046
2047 if (scsicmd[0] == INQUIRY) { 2047 if ((scsicmd[0] == INQUIRY) && ((scsicmd[1] & 0x03) == 0)) {
2048 u8 *buf = NULL; 2048 u8 *buf = NULL;
2049 unsigned int buflen; 2049 unsigned int buflen;
2050 2050
@@ -2058,9 +2058,6 @@ static int atapi_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask)
2058 * device. 2) Ensure response data format / ATAPI information 2058 * device. 2) Ensure response data format / ATAPI information
2059 * are always correct. 2059 * are always correct.
2060 */ 2060 */
2061 /* FIXME: do we ever override EVPD pages and the like, with
2062 * this code?
2063 */
2064 if (buf[2] == 0) { 2061 if (buf[2] == 0) {
2065 buf[2] = 0x5; 2062 buf[2] = 0x5;
2066 buf[3] = 0x32; 2063 buf[3] = 0x32;