scsi: pmcraid: Select device in pmcraid_eh_target_reset_handler()
The reset code requires a device to be selected, but we shouldn't rely on the command to provide a device for us. So select the first device on the target when sending down a target reset. Signed-off-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20231002154328.43718-18-hare@suse.de Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
09df469722
commit
c2a14ab3b9
1 changed files with 14 additions and 2 deletions
|
@ -3064,9 +3064,21 @@ static int pmcraid_eh_bus_reset_handler(struct scsi_cmnd *scmd)
|
||||||
|
|
||||||
static int pmcraid_eh_target_reset_handler(struct scsi_cmnd *scmd)
|
static int pmcraid_eh_target_reset_handler(struct scsi_cmnd *scmd)
|
||||||
{
|
{
|
||||||
scmd_printk(KERN_INFO, scmd,
|
struct Scsi_Host *shost = scmd->device->host;
|
||||||
|
struct scsi_device *scsi_dev = NULL, *tmp;
|
||||||
|
|
||||||
|
shost_for_each_device(tmp, shost) {
|
||||||
|
if ((tmp->channel == scmd->device->channel) &&
|
||||||
|
(tmp->id == scmd->device->id)) {
|
||||||
|
scsi_dev = tmp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!scsi_dev)
|
||||||
|
return FAILED;
|
||||||
|
sdev_printk(KERN_INFO, scsi_dev,
|
||||||
"Doing target reset due to an I/O command timeout.\n");
|
"Doing target reset due to an I/O command timeout.\n");
|
||||||
return pmcraid_reset_device(scmd->device,
|
return pmcraid_reset_device(scsi_dev,
|
||||||
PMCRAID_INTERNAL_TIMEOUT,
|
PMCRAID_INTERNAL_TIMEOUT,
|
||||||
RESET_DEVICE_TARGET);
|
RESET_DEVICE_TARGET);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue