aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl/ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cam/ctl/ctl.c')
-rw-r--r--sys/cam/ctl/ctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 20877065ccc0..4e6fcb7ef778 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -12046,7 +12046,9 @@ ctl_inject_error(struct ctl_lun *lun, union ctl_io *io)
ctl_set_aborted(&io->scsiio);
break;
case CTL_LUN_INJ_MEDIUM_ERR:
- ctl_set_medium_error(&io->scsiio);
+ ctl_set_medium_error(&io->scsiio,
+ (io->io_hdr.flags & CTL_FLAG_DATA_MASK) !=
+ CTL_FLAG_DATA_OUT);
break;
case CTL_LUN_INJ_UA:
/* 29h/00h POWER ON, RESET, OR BUS DEVICE RESET