• Martin K. Petersen's avatar
    [SCSI] Handle disk devices which can not process medium access commands · 18a4d0a2
    Martin K. Petersen authored
    We have experienced several devices which fail in a fashion we do not
    currently handle gracefully in SCSI. After a failure these devices will
    respond to the SCSI primary command set (INQUIRY, TEST UNIT READY, etc.)
    but any command accessing the storage medium will time out.
    
    The following patch adds an callback that can be used by upper level
    drivers to inspect the results of an error handling command. This in
    turn has been used to implement additional checking in the SCSI disk
    driver.
    
    If a medium access command fails twice but TEST UNIT READY succeeds both
    times in the subsequent error handling we will offline the device. The
    maximum number of failed commands required to take a device offline can
    be tweaked in sysfs.
    
    Also add a new error flag to scsi_debug which allows this scenario to be
    easily reproduced.
    
    [jejb: fix up integer parsing to use kstrtouint]
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
    18a4d0a2
sd.c 78.5 KB