From owner-svn-src-all@freebsd.org Fri Feb 24 12:12:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B25ECEB848; Fri, 24 Feb 2017 12:12:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC7AB106F; Fri, 24 Feb 2017 12:12:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1OCCUL1037870; Fri, 24 Feb 2017 12:12:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1OCCUf0037869; Fri, 24 Feb 2017 12:12:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702241212.v1OCCUf0037869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 24 Feb 2017 12:12:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314204 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2017 12:12:32 -0000 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,