提交 f9ba7af8 编写于 作者: M Martin Wilck 提交者: Martin K. Petersen

scsi: scsi_debug: reset injection flags for every_nth > 0

If every_nth > 0, the injection flags must be reset for commands that
aren't supposed to fail (i.e. that aren't "nth"). Otherwise, commands
will continue to fail, like in the every_nth < 0 case.
Signed-off-by: NMartin Wilck <mwilck@suse.com>
Acked-by: NDouglas Gilbert <dgilbert@interlog.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 80c49563
...@@ -4294,8 +4294,13 @@ static void clear_queue_stats(void) ...@@ -4294,8 +4294,13 @@ static void clear_queue_stats(void)
static void setup_inject(struct sdebug_queue *sqp, static void setup_inject(struct sdebug_queue *sqp,
struct sdebug_queued_cmd *sqcp) struct sdebug_queued_cmd *sqcp)
{ {
if ((atomic_read(&sdebug_cmnd_count) % abs(sdebug_every_nth)) > 0) if ((atomic_read(&sdebug_cmnd_count) % abs(sdebug_every_nth)) > 0) {
if (sdebug_every_nth > 0)
sqcp->inj_recovered = sqcp->inj_transport
= sqcp->inj_dif
= sqcp->inj_dix = sqcp->inj_short = 0;
return; return;
}
sqcp->inj_recovered = !!(SDEBUG_OPT_RECOVERED_ERR & sdebug_opts); sqcp->inj_recovered = !!(SDEBUG_OPT_RECOVERED_ERR & sdebug_opts);
sqcp->inj_transport = !!(SDEBUG_OPT_TRANSPORT_ERR & sdebug_opts); sqcp->inj_transport = !!(SDEBUG_OPT_TRANSPORT_ERR & sdebug_opts);
sqcp->inj_dif = !!(SDEBUG_OPT_DIF_ERR & sdebug_opts); sqcp->inj_dif = !!(SDEBUG_OPT_DIF_ERR & sdebug_opts);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册