The abort state is being stored persistently across commands, meaning if the
command times out a second time, the error handler thinks an abort is still
pending.  Fix this by properly resetting the abort flag after the abort is
finished.

Signed-off-by: James Bottomley <jbottom...@parallels.com>
---
 drivers/scsi/scsi_error.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 771c16b..b9f3b07 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -869,10 +869,13 @@ static int scsi_try_bus_device_reset(struct scsi_cmnd 
*scmd)
 
 static int scsi_try_to_abort_cmd(struct scsi_host_template *hostt, struct 
scsi_cmnd *scmd)
 {
-       if (!hostt->eh_abort_handler)
-               return FAILED;
+       int retval = FAILED;
+
+       if (hostt->eh_abort_handler)
+               retval = hostt->eh_abort_handler(scmd);
 
-       return hostt->eh_abort_handler(scmd);
+       scmd->eh_eflags &= ~SCSI_EH_ABORT_SCHEDULED;
+       return retval;
 }
 
 static void scsi_abort_eh_cmnd(struct scsi_cmnd *scmd)
-- 
1.9.1



--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to