aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-09 21:54:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-09 21:54:06 -0400
commit1c54fc1efe6922b4e7ffd591739d72050976ccd6 (patch)
tree0f7f0eaa91fa06bba11da240915eb6a4040b482a /drivers/scsi/scsi_debug.c
parentf4f9b8fc73f9aa93744f0e91e18f367d7766f523 (diff)
parentb4c43993f448d0e25fe40690d9e9c81a8ebda623 (diff)
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley: "This patch consists of the usual driver updates (qla2xxx, qla4xxx, lpfc, be2iscsi, fnic, ufs, NCR5380) The NCR5380 is the addition to maintained status of a long neglected driver for older hardware. In addition there are a lot of minor fixes and cleanups and some more updates to make scsi mq ready" * tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (130 commits) include/scsi/osd_protocol.h: remove unnecessary __constant mvsas: Recognise device/subsystem 9485/9485 as 88SE9485 Revert "be2iscsi: Fix processing cqe for cxn whose endpoint is freed" mptfusion: fix msgContext in mptctl_hp_hostinfo acornscsi: remove linked command support scsi/NCR5380: dprintk macro fusion: Remove use of DEF_SCSI_QCMD fusion: Add free msg frames to the head, not tail of list mpt2sas: Add free smids to the head, not tail of list mpt2sas: Remove use of DEF_SCSI_QCMD mpt2sas: Remove uses of serial_number mpt3sas: Remove use of DEF_SCSI_QCMD mpt3sas: Remove uses of serial_number qla2xxx: Use kmemdup instead of kmalloc + memcpy qla4xxx: Use kmemdup instead of kmalloc + memcpy qla2xxx: fix incorrect debug printk be2iscsi: Bump the driver version be2iscsi: Fix processing cqe for cxn whose endpoint is freed be2iscsi: Fix destroy MCC-CQ before MCC-EQ is destroyed be2iscsi: Fix memory corruption in MBX path ...
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,