From owner-svn-src-stable-9@FreeBSD.ORG Sun Sep 2 15:07:51 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95166106566B; Sun, 2 Sep 2012 15:07:51 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E9618FC08; Sun, 2 Sep 2012 15:07:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q82F7pH4022752; Sun, 2 Sep 2012 15:07:51 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q82F7pk0022750; Sun, 2 Sep 2012 15:07:51 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201209021507.q82F7pk0022750@svn.freebsd.org> From: Matt Jacob Date: Sun, 2 Sep 2012 15:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240019 - stable/9/sys/dev/isp X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 15:07:51 -0000 Author: mjacob Date: Sun Sep 2 15:07:51 2012 New Revision: 240019 URL: http://svn.freebsd.org/changeset/base/240019 Log: MFC of 239330 On lun disable, complete all INOTs and ATIOs with CAM_REQ_ABORTED. Modified: stable/9/sys/dev/isp/isp_freebsd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/isp/ (props changed) Modified: stable/9/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/9/sys/dev/isp/isp_freebsd.c Sun Sep 2 15:06:55 2012 (r240018) +++ stable/9/sys/dev/isp/isp_freebsd.c Sun Sep 2 15:07:51 2012 (r240019) @@ -1154,10 +1154,27 @@ create_lun_state(ispsoftc_t *isp, int bu static ISP_INLINE void destroy_lun_state(ispsoftc_t *isp, tstate_t *tptr) { + union ccb *ccb; struct tslist *lhp; KASSERT((tptr->hold != 0), ("tptr is not held")); KASSERT((tptr->hold == 1), ("tptr still held (%d)", tptr->hold)); + do { + ccb = (union ccb *)SLIST_FIRST(&tptr->atios); + if (ccb) { + SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle); + ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(ccb); + } + } while (ccb); + do { + ccb = (union ccb *)SLIST_FIRST(&tptr->inots); + if (ccb) { + SLIST_REMOVE_HEAD(&tptr->inots, sim_links.sle); + ccb->ccb_h.status = CAM_REQ_ABORTED; + xpt_done(ccb); + } + } while (ccb); ISP_GET_PC_ADDR(isp, cam_sim_bus(xpt_path_sim(tptr->owner)), lun_hash[LUN_HASH_FUNC(xpt_path_lun_id(tptr->owner))], lhp); SLIST_REMOVE(lhp, tptr, tstate, next); ISP_PATH_PRT(isp, ISP_LOGTDEBUG0, tptr->owner, "destroyed tstate\n"); @@ -1472,8 +1489,8 @@ done: } ccb->ccb_h.status = status; if (status == CAM_REQ_CMP) { - xpt_print(ccb->ccb_h.path, "lun now disabled for target mode\n"); destroy_lun_state(isp, tptr); + xpt_print(ccb->ccb_h.path, "lun now disabled for target mode\n"); } else { if (tptr) rls_lun_statep(isp, tptr);