aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index f3e9cc038d1d..1328a2621070 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -130,6 +130,7 @@ static const char * scsi_debug_version_date = "20100324";
130#define SCSI_DEBUG_OPT_DIF_ERR 32 130#define SCSI_DEBUG_OPT_DIF_ERR 32
131#define SCSI_DEBUG_OPT_DIX_ERR 64 131#define SCSI_DEBUG_OPT_DIX_ERR 64
132#define SCSI_DEBUG_OPT_MAC_TIMEOUT 128 132#define SCSI_DEBUG_OPT_MAC_TIMEOUT 128
133#define SCSI_DEBUG_OPT_SHORT_TRANSFER 256
133/* When "every_nth" > 0 then modulo "every_nth" commands: 134/* When "every_nth" > 0 then modulo "every_nth" commands:
134 * - a no response is simulated if SCSI_DEBUG_OPT_TIMEOUT is set 135 * - a no response is simulated if SCSI_DEBUG_OPT_TIMEOUT is set
135 * - a RECOVERED_ERROR is simulated on successful read and write 136 * - a RECOVERED_ERROR is simulated on successful read and write
@@ -3583,6 +3584,7 @@ int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done)
3583 int inj_transport = 0; 3584 int inj_transport = 0;
3584 int inj_dif = 0; 3585 int inj_dif = 0;
3585 int inj_dix = 0; 3586 int inj_dix = 0;
3587 int inj_short = 0;
3586 int delay_override = 0; 3588 int delay_override = 0;
3587 int unmap = 0; 3589 int unmap = 0;
3588 3590
@@ -3628,6 +3630,8 @@ int scsi_debug_queuecommand_lck(struct scsi_cmnd *SCpnt, done_funct_t done)
3628 inj_dif = 1; /* to reads and writes below */ 3630 inj_dif = 1; /* to reads and writes below */
3629 else if (SCSI_DEBUG_OPT_DIX_ERR & scsi_debug_opts) 3631 else if (SCSI_DEBUG_OPT_DIX_ERR & scsi_debug_opts)
3630 inj_dix = 1; /* to reads and writes below */ 3632 inj_dix = 1; /* to reads and writes below */
3633 else if (SCSI_DEBUG_OPT_SHORT_TRANSFER & scsi_debug_opts)
3634 inj_short = 1;
3631 } 3635 }
3632 3636
3633 if (devip->wlun) { 3637 if (devip->wlun) {
@@ -3744,6 +3748,10 @@ read:
3744 if (scsi_debug_fake_rw) 3748 if (scsi_debug_fake_rw)
3745 break; 3749 break;
3746 get_data_transfer_info(cmd, &lba, &num, &ei_lba); 3750 get_data_transfer_info(cmd, &lba, &num, &ei_lba);
3751
3752 if (inj_short)
3753 num /= 2;
3754
3747 errsts = resp_read(SCpnt, lba, num, devip, ei_lba); 3755 errsts = resp_read(SCpnt, lba, num, devip, ei_lba);
3748 if (inj_recovered && (0 == errsts)) { 3756 if (inj_recovered && (0 == errsts)) {
3749 mk_sense_buffer(devip, RECOVERED_ERROR, 3757 mk_sense_buffer(devip, RECOVERED_ERROR,