Commit 5af23d26 authored by Brian King's avatar Brian King Committed by James Bottomley
Browse files

[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: default avatarBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 9f28745a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3954,6 +3954,13 @@ static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd)
		spin_unlock_irq(scsi_cmd->device->host->host_lock);
		ata_do_eh(ap, NULL, NULL, ipr_sata_reset, NULL);
		spin_lock_irq(scsi_cmd->device->host->host_lock);

		list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) {
			if (ipr_cmd->ioarcb.res_handle == res->cfgte.res_handle) {
				rc = -EIO;
				break;
			}
		}
	} else
		rc = ipr_device_reset(ioa_cfg, res);
	res->resetting_device = 0;