[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: Jack Hammer <jack_hammer@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
committed by
James Bottomley
parent
2254c86db1
commit
a5b3c86e4b
@@ -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)
|
|||||||
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)
|
|||||||
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)
|
|||||||
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 */
|
||||||
|
Reference in New Issue
Block a user