diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2007-03-29 13:43:17 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-04-01 12:17:22 -0400 |
commit | 24d6f2b50bd34d0da540a9e6f71c4b6ab25f4b93 (patch) | |
tree | 0242527fe42d4d03c899ce2ef5798b072b9309d1 /drivers/scsi/ipr.c | |
parent | b0692dd4d7e90ce5cf1241731c6e80118402e3b4 (diff) |
[SCSI] ipr: Fix for oops following SATA request sense
This patch fixes a problem discovered on a system with some
bad SATA devices attached. If a command to a SATAPI device
times out and the device gets reset as part of error recovery,
its possible that ipr will set err_mask to indicate a device
error has occurred. If this happens, a request sense will get
issued by libata. Since scsi core thinks this scsi command is
now completed, because the device reset handler completed successfully,
scsi core will free the associated scsi command, which may
cause an oops when that request sense is completed later
by ipr. This patch ensures that any commands that get aborted
as a result of a device reset set err_mask appropriately so
that the request sense does not get sent.
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 | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 44ce9f5218a8..fc1171c7def4 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -3846,6 +3846,8 @@ static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd) | |||
3846 | if (ipr_cmd->ioarcb.res_handle == res->cfgte.res_handle) { | 3846 | if (ipr_cmd->ioarcb.res_handle == res->cfgte.res_handle) { |
3847 | if (ipr_cmd->scsi_cmd) | 3847 | if (ipr_cmd->scsi_cmd) |
3848 | ipr_cmd->done = ipr_scsi_eh_done; | 3848 | ipr_cmd->done = ipr_scsi_eh_done; |
3849 | if (ipr_cmd->qc) | ||
3850 | ipr_cmd->done = ipr_sata_eh_done; | ||
3849 | if (ipr_cmd->qc && !(ipr_cmd->qc->flags & ATA_QCFLAG_FAILED)) { | 3851 | if (ipr_cmd->qc && !(ipr_cmd->qc->flags & ATA_QCFLAG_FAILED)) { |
3850 | ipr_cmd->qc->err_mask |= AC_ERR_TIMEOUT; | 3852 | ipr_cmd->qc->err_mask |= AC_ERR_TIMEOUT; |
3851 | ipr_cmd->qc->flags |= ATA_QCFLAG_FAILED; | 3853 | ipr_cmd->qc->flags |= ATA_QCFLAG_FAILED; |