• Wenchao Hao's avatar
    scsi: scsi_debug: Add new error injection type: Abort Failed · 5551ce92
    Wenchao Hao authored
    Add error injection type 3 to make scsi_debug_abort() return FAILED.  Fail
    abort command format:
    
      +--------+------+-------------------------------------------------------+
      | Column | Type | Description                                           |
      +--------+------+-------------------------------------------------------+
      |   1    |  u8  | Error type, fixed to 0x3                              |
      +--------+------+-------------------------------------------------------+
      |   2    |  s32 | Error count                                           |
      |        |      |  0: this rule will be ignored                         |
      |        |      |  positive: the rule will always take effect           |
      |        |      |  negative: the rule takes effect n times where -n is  |
      |        |      |            the value given. Ignored after n times     |
      +--------+------+-------------------------------------------------------+
      |   3    |  x8  | SCSI command opcode, 0xff for all commands            |
      +--------+------+-------------------------------------------------------+
    
    Examples:
    
        error=/sys/kernel/debug/scsi_debug/0:0:0:1/error
        echo "3 -10 0x12" > ${error}
    
    will make the device return FAILED when aborting inquiry command 10 times.
    Signed-off-by: default avatarWenchao Hao <haowenchao2@huawei.com>
    Link: https://lore.kernel.org/r/20231010092051.608007-8-haowenchao2@huawei.comTested-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    5551ce92
scsi_debug.c 235 KB