[PATCH 06/12] ipr: Fix for oops following SATA request sense

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
---

 linux-2.6-bjking1/drivers/scsi/ipr.c |    2 ++
 1 files changed, 2 insertions(+)

diff -puN drivers/scsi/ipr.c~ipr_sata_req_sense_oops drivers/scsi/ipr.c
--- linux-2.6/drivers/scsi/ipr.c~ipr_sata_req_sense_oops	2007-03-23 15:24:19.000000000 -0500
+++ linux-2.6-bjking1/drivers/scsi/ipr.c	2007-03-23 15:24:19.000000000 -0500
@@ -3846,6 +3846,8 @@ static int __ipr_eh_dev_reset(struct scs
 		if (ipr_cmd->ioarcb.res_handle == res->cfgte.res_handle) {
 			if (ipr_cmd->scsi_cmd)
 				ipr_cmd->done = ipr_scsi_eh_done;
+			if (ipr_cmd->qc)
+				ipr_cmd->done = ipr_sata_eh_done;
 			if (ipr_cmd->qc && !(ipr_cmd->qc->flags & ATA_QCFLAG_FAILED)) {
 				ipr_cmd->qc->err_mask |= AC_ERR_TIMEOUT;
 				ipr_cmd->qc->flags |= ATA_QCFLAG_FAILED;
_
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux