aboutsummaryrefslogtreecommitdiff
path: root/sys/cam
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2015-01-16 12:35:55 +0000
committerAlexander Motin <mav@FreeBSD.org>2015-01-16 12:35:55 +0000
commit1b922b707ef070626fb7a25dbd0c32306a9d30f6 (patch)
tree3fe3b59626db279dca23822332fbe1872dc7c06d /sys/cam
parentc8563d530cddd985593183fa814a0167f0698672 (diff)
downloadsrc-1b922b707ef070626fb7a25dbd0c32306a9d30f6.tar.gz
src-1b922b707ef070626fb7a25dbd0c32306a9d30f6.zip
Don't count status as sent until CTIO completes successfully.
If we aggregated status sending with data move and got error, allow status to be updated and resent again separately. Without this command may stuck without status sent at all. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=277247
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/ctl/scsi_ctl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c
index b1dba8c08956..ba595508bde4 100644
--- a/sys/cam/ctl/scsi_ctl.c
+++ b/sys/cam/ctl/scsi_ctl.c
@@ -891,7 +891,6 @@ ctlfestart(struct cam_periph *periph, union ccb *start_ccb)
(cmd_info->flags & CTLFE_CMD_PIECEWISE) == 0 &&
((io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) == 0 ||
io->io_hdr.status == CTL_SUCCESS)) {
- io->io_hdr.flags |= CTL_FLAG_STATUS_SENT;
flags |= CAM_SEND_STATUS;
scsi_status = io->scsiio.scsi_status;
csio->sense_len = io->scsiio.sense_len;
@@ -1265,6 +1264,10 @@ ctlfedone(struct cam_periph *periph, union ccb *done_ccb)
break;
}
+ if ((done_ccb->ccb_h.flags & CAM_SEND_STATUS) &&
+ (done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)
+ io->io_hdr.flags |= CTL_FLAG_STATUS_SENT;
+
/*
* If we were sending status back to the initiator, free up
* resources. If we were doing a datamove, call the