svn commit: r314204 - head/sys/cam/ctl

Alexander Motin mav at FreeBSD.org
Fri Feb 24 12:12:32 UTC 2017


Author: mav
Date: Fri Feb 24 12:12:30 2017
New Revision: 314204
URL: https://svnweb.freebsd.org/changeset/base/314204

Log:
  Explicitly abort ATIO if CTIO sending status has failed.
  
  This helps SIM to free related resources in questionable cases.
  
  MFC after:	2 weeks

Modified:
  head/sys/cam/ctl/scsi_ctl.c

Modified: head/sys/cam/ctl/scsi_ctl.c
==============================================================================
--- head/sys/cam/ctl/scsi_ctl.c	Fri Feb 24 12:11:17 2017	(r314203)
+++ head/sys/cam/ctl/scsi_ctl.c	Fri Feb 24 12:12:30 2017	(r314204)
@@ -1282,6 +1282,14 @@ ctlfedone(struct cam_periph *periph, uni
 		 * 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,


More information about the svn-src-all mailing list