• Laurence Oberman's avatar
    scsi: scsi_debug: Add two new parameters to scsi_debug driver · d9da891a
    Laurence Oberman authored
    This patch adds two new parameters to the scsi_debug driver.
    
    During various fault injection scenarios it would be useful to be able
    to pick a specific starting sector and number of follow on sectors where
    a MEDIUM ERROR for reads would be returned against a scsi-debug device.
    
    Right now this only works against sector 0x1234 and OPT_MEDIUM_ERR_NUM
    follow on sectors.  However during testing of md-raid and other
    scenarios I wanted more flexibility.
    
    The idea is add 2 new parameters:
    
        medium_error_start
        medium_error_count
    
    If medium_error_start is set then we don't use the default of
    OPT_MEDIUM_ERR_ADDR, but use that set value.
    
    If medium_error_count is set we use that value otherwise default to
    OPT_MEDIUM_ERR_NUM.
    Signed-off-by: default avatarLaurence Oberman <loberman@redhat.com>
    Acked-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    d9da891a
scsi_debug.c 172 KB