summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2017-03-06 06:29:10 +0000
committermav <mav@FreeBSD.org>2017-03-06 06:29:10 +0000
commit40fd71c6db51bec271e35a2328bc6a3b9cef510a (patch)
tree2f95ce334525abcebf2bba13036aef231cb60678
parentb353d9286d3cc4d48afb165999941f56c7bedfe9 (diff)
downloadFreeBSD-src-40fd71c6db51bec271e35a2328bc6a3b9cef510a.zip
FreeBSD-src-40fd71c6db51bec271e35a2328bc6a3b9cef510a.tar.gz
MFC r314204: Explicitly abort ATIO if CTIO sending status has failed.
This helps SIM to free related resources in questionable cases.
-rw-r--r--sys/cam/ctl/scsi_ctl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c
index 2078be3..2fc036d 100644
--- a/sys/cam/ctl/scsi_ctl.c
+++ b/sys/cam/ctl/scsi_ctl.c
@@ -1288,6 +1288,14 @@ ctlfedone(struct cam_periph *periph, union ccb *done_ccb)
* datamove done routine.
*/
if ((io->io_hdr.flags & CTL_FLAG_DMA_INPROG) == 0) {
+ /* Abort ATIO if CTIO sending status has failed. */
+ if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) !=
+ CAM_REQ_CMP) {
+ done_ccb->ccb_h.func_code = XPT_ABORT;
+ done_ccb->cab.abort_ccb = (union ccb *)atio;
+ xpt_action(done_ccb);
+ }
+
softc->ccbs_freed++;
xpt_release_ccb(done_ccb);
ctlfe_requeue_ccb(periph, (union ccb *)atio,
OpenPOWER on IntegriCloud