OSDN Git Service

scsi: scsi_debug: Add two new parameters to scsi_debug driver
authorLaurence Oberman <loberman@redhat.com>
Sat, 3 Feb 2018 18:38:35 +0000 (13:38 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 14 Feb 2018 02:36:53 +0000 (21:36 -0500)
commitd9da891a892a38db4ec7abcc2df57f9ae3777d99
treeba76d3d3650a610f520a937f29543ebee12cc97c
parent458df78b1c513de9311afd913bdf93777af2d157
scsi: scsi_debug: Add two new parameters to scsi_debug driver

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: Laurence Oberman <loberman@redhat.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_debug.c