• Alan Stern's avatar
    [SCSI] simplify scsi_io_completion() · b60af5b0
    Alan Stern authored
    
    
    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: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
    b60af5b0
scsi_lib.c 68.2 KB