diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-02-19 21:48:42 -0600 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-02-22 16:57:14 -0600 |
commit | a8e14fec164cc01d8dfb18760ee9bddd91e127c2 (patch) | |
tree | 8e2c2e5933d2f41ecc0e37be448e9407029508c8 /drivers/sbus/char | |
parent | 69e562c234440fb7410877b5b24f4b29ef8521d1 (diff) |
[SCSI] libsas: fix error handling
The libsas error handler has two fairly fatal bugs
1. scsi_sas_task_done calls scsi_eh_finish_cmd() too early. This
happens if the task completes after it has been aborted but before
the error handler starts up. Because scsi_eh_finish_cmd()
decrements host_failed and adds the task to the done list, the
error handler start check (host_failed == host_busy) never passes
and the eh never starts.
2. The multiple task completion paths sas_scsi_clear_queue_... all
simply delete the task from the error queue. This causes it to
disappear into the ether, since a command must be placed on the
done queue to be finished off by the error handler. This behaviour
causes the HBA to hang on pending commands.
Fix 1. by moving the SAS_TASK_STATE_ABORTED check to an exit clause at
the top of the routine and calling ->scsi_done() unconditionally (it
is a nop if the timer has fired). This keeps the task in the error
handling queue until the eh starts.
Fix 2. by making sure every task goes through task complete followed
by scsi_eh_finish_cmd().
Tested this by firing resets across a disk running a hammer test (now
it actually survives without hanging the system)
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/sbus/char')
0 files changed, 0 insertions, 0 deletions