Commit a5b3c86e authored by Jack Hammer's avatar Jack Hammer Committed by James Bottomley

[SCSI] ServeRAID: prevent seeing DADSI devices

A critical thing the ServeRAID driver MUST do is hide the physical DASDI
devices from the OS. It does this by intercepting the INQUIRY commands.

In recent 2.6.15 testing, I discovered this to be failing.

The cause was the driver assuming that the INQUIRY response data was in a
simple single buffer, when it was actually a 1 element scatter gather list.

This patch makes ips always look at the correct data when examining an
INQUIRY response.
Signed-off-by: default avatarJack Hammer <jack_hammer@adaptec.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 2254c86d
...@@ -3499,6 +3499,7 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) ...@@ -3499,6 +3499,7 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp)
int device_error; int device_error;
uint32_t transfer_len; uint32_t transfer_len;
IPS_DCDB_TABLE_TAPE *tapeDCDB; IPS_DCDB_TABLE_TAPE *tapeDCDB;
IPS_SCSI_INQ_DATA inquiryData;
METHOD_TRACE("ips_map_status", 1); METHOD_TRACE("ips_map_status", 1);
...@@ -3557,14 +3558,14 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) ...@@ -3557,14 +3558,14 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp)
errcode = DID_OK; errcode = DID_OK;
/* Restrict access to physical DASD */ /* Restrict access to physical DASD */
if ((scb->scsi_cmd->cmnd[0] == INQUIRY) && if (scb->scsi_cmd->cmnd[0] == INQUIRY) {
((((char *) scb->scsi_cmd-> ips_scmd_buf_read(scb->scsi_cmd,
buffer)[0] & 0x1f) == TYPE_DISK)) { &inquiryData, sizeof (inquiryData));
/* underflow -- no error */ if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) {
/* restrict access to physical DASD */
errcode = DID_TIME_OUT; errcode = DID_TIME_OUT;
break; break;
} }
}
} else } else
errcode = DID_ERROR; errcode = DID_ERROR;
...@@ -4135,6 +4136,7 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) ...@@ -4135,6 +4136,7 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus)
uint8_t basic_status; uint8_t basic_status;
uint8_t ext_status; uint8_t ext_status;
int errcode; int errcode;
IPS_SCSI_INQ_DATA inquiryData;
METHOD_TRACE("ips_chkstatus", 1); METHOD_TRACE("ips_chkstatus", 1);
...@@ -4255,10 +4257,10 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) ...@@ -4255,10 +4257,10 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus)
scb->scsi_cmd->result = errcode << 16; scb->scsi_cmd->result = errcode << 16;
} else { /* bus == 0 */ } else { /* bus == 0 */
/* restrict access to physical drives */ /* restrict access to physical drives */
if ((scb->scsi_cmd->cmnd[0] == INQUIRY) && if (scb->scsi_cmd->cmnd[0] == INQUIRY) {
((((char *) scb->scsi_cmd->buffer)[0] & 0x1f) == ips_scmd_buf_read(scb->scsi_cmd,
TYPE_DISK)) { &inquiryData, sizeof (inquiryData));
if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK)
scb->scsi_cmd->result = DID_TIME_OUT << 16; scb->scsi_cmd->result = DID_TIME_OUT << 16;
} }
} /* else */ } /* else */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment