diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2007-05-09 16:36:35 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-05-16 12:39:33 -0400 |
commit | 5af23d263c33a3f6fc93facfd87d2a091eff2060 (patch) | |
tree | e49db9c342a2c62d4996bc9a323f0e0d05c5e671 /drivers/scsi/ipr.c | |
parent | 9f28745a6b554fdd6b0dbc9856077701a55f9569 (diff) |
[SCSI] ipr: Proper return codes for eh_dev_reset for SATA devices
Currently ipr always returns success from eh_dev_reset when
called for a SATA device. If ata_do_eh is unable to recover
for some reason, this can result in commands that are still
outstanding when ata_do_eh returns. Change ipr to verify no
commands are outstanding before returning success.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r-- | drivers/scsi/ipr.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 4baa79e68679..fa6ff295e568 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -3954,6 +3954,13 @@ static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd) | |||
3954 | spin_unlock_irq(scsi_cmd->device->host->host_lock); | 3954 | spin_unlock_irq(scsi_cmd->device->host->host_lock); |
3955 | ata_do_eh(ap, NULL, NULL, ipr_sata_reset, NULL); | 3955 | ata_do_eh(ap, NULL, NULL, ipr_sata_reset, NULL); |
3956 | spin_lock_irq(scsi_cmd->device->host->host_lock); | 3956 | spin_lock_irq(scsi_cmd->device->host->host_lock); |
3957 | |||
3958 | list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) { | ||
3959 | if (ipr_cmd->ioarcb.res_handle == res->cfgte.res_handle) { | ||
3960 | rc = -EIO; | ||
3961 | break; | ||
3962 | } | ||
3963 | } | ||
3957 | } else | 3964 | } else |
3958 | rc = ipr_device_reset(ioa_cfg, res); | 3965 | rc = ipr_device_reset(ioa_cfg, res); |
3959 | res->resetting_device = 0; | 3966 | res->resetting_device = 0; |