[SCSI] simplify scsi_io_completion()
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 3 Nov 2008 20:56:47 +0000 (15:56 -0500)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 29 Dec 2008 17:24:18 +0000 (11:24 -0600)
commitb60af5b0adf0da24c673598c8d3fb4d4189a15ce
tree95981f6b1fd122c3a751cdb733ce0489a375c8aa
parent67e6d58d812ec3e95918266076d4c836cdec849a
[SCSI] simplify scsi_io_completion()

This patch (as1142b) consolidates a lot of repetitious code in
scsi_io_completion().  It also fixes a few comments.  Most
importantly, however, it clearly distinguishes among the three sorts
of retries that can be done when a command fails to complete:

Unprepare the request and resubmit it, so that a new
command will be created for it.

Requeue the request directly so that it will be retried
immediately using the same command.

Requeue the request so that it will be retried following
a short delay.

Complete the remainder of the request with an I/O error.

[jejb: Updates
     1. For several error conditions, we would now print the sense twice
        in slightly different ways, so unify the location of sense
        printing.
     2. I added more descriptions to actual failure conditions for
        better debugging
     3. according to spec, ABORTED_COMMAND is supposed to be retried
        (except on DIF failure).  Our old behaviour of erroring it looks
        to be a bug.
     4. I'd prefer not to default initialise the action variable because
        that ensures that every leg of the error handler has an
        associated action and the compiler will warn if someone later
        accidentally misses one or removes one.
]
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/scsi_lib.c