Skip to content

Commit 57abab7

Browse files
Kevin Barnettmartinkpetersen
authored andcommitted
scsi: smartpqi: Improve handling of multipath failover
Improve multipath failovers by mapping firmware errors into I/O errors. In some rare instances, firmware does not return the proper error code for I/O errors caused by a multipath path failure. Map I/O errors returned by firmware into errors that help the multipath layer to detect the failure of a path. Reviewed-by: Gerry Morong <[email protected]> Reviewed-by: Scott Benesh <[email protected]> Reviewed-by: Scott Teel <[email protected]> Reviewed-by: Mike McGowen <[email protected]> Signed-off-by: Kevin Barnett <[email protected]> Signed-off-by: Don Brace <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent f1393d5 commit 57abab7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

drivers/scsi/smartpqi/smartpqi_init.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3247,6 +3247,20 @@ static void pqi_process_raid_io_error(struct pqi_io_request *io_request)
32473247
sense_data_length);
32483248
}
32493249

3250+
if (pqi_cmd_priv(scmd)->this_residual &&
3251+
!pqi_is_logical_device(scmd->device->hostdata) &&
3252+
scsi_status == SAM_STAT_CHECK_CONDITION &&
3253+
host_byte == DID_OK &&
3254+
sense_data_length &&
3255+
scsi_normalize_sense(error_info->data, sense_data_length, &sshdr) &&
3256+
sshdr.sense_key == ILLEGAL_REQUEST &&
3257+
sshdr.asc == 0x26 &&
3258+
sshdr.ascq == 0x0) {
3259+
host_byte = DID_NO_CONNECT;
3260+
pqi_take_device_offline(scmd->device, "AIO");
3261+
scsi_build_sense_buffer(0, scmd->sense_buffer, HARDWARE_ERROR, 0x3e, 0x1);
3262+
}
3263+
32503264
scmd->result = scsi_status;
32513265
set_host_byte(scmd, host_byte);
32523266
}
@@ -6021,7 +6035,7 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scm
60216035

60226036
ctrl_info = shost_to_hba(shost);
60236037

6024-
if (pqi_ctrl_offline(ctrl_info) || pqi_device_in_remove(device)) {
6038+
if (pqi_ctrl_offline(ctrl_info) || pqi_device_offline(device) || pqi_device_in_remove(device)) {
60256039
set_host_byte(scmd, DID_NO_CONNECT);
60266040
pqi_scsi_done(scmd);
60276041
return 0;

0 commit comments

Comments
 (0)