From owner-svn-src-stable@freebsd.org Mon Oct 5 09:21:45 2015 Return-Path: Delivered-To: svn-src-stable@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 DE4FAA11E9C; Mon, 5 Oct 2015 09:21:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 B5A7328A; Mon, 5 Oct 2015 09:21:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t959LjvM042389; Mon, 5 Oct 2015 09:21:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t959Lj3C042378; Mon, 5 Oct 2015 09:21:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201510050921.t959Lj3C042378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 5 Oct 2015 09:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r288759 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2015 09:21:46 -0000 Author: mav Date: Mon Oct 5 09:21:45 2015 New Revision: 288759 URL: https://svnweb.freebsd.org/changeset/base/288759 Log: MFC r287818: Fix completion/error status reporting. Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Oct 5 09:20:57 2015 (r288758) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Oct 5 09:21:45 2015 (r288759) @@ -438,7 +438,8 @@ cfcs_datamove(union ctl_io *io) if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) { io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = NULL; io->io_hdr.flags |= CTL_FLAG_STATUS_SENT; - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status &= ~CAM_STATUS_MASK; + ccb->ccb_h.status |= CAM_REQ_CMP; xpt_done(ccb); } @@ -465,12 +466,13 @@ cfcs_done(union ctl_io *io) /* * Translate CTL status to CAM status. */ + ccb->ccb_h.status &= ~CAM_STATUS_MASK; switch (io->io_hdr.status & CTL_STATUS_MASK) { case CTL_SUCCESS: - ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status |= CAM_REQ_CMP; break; case CTL_SCSI_ERROR: - ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; + ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; ccb->csio.scsi_status = io->scsiio.scsi_status; bcopy(&io->scsiio.sense_data, &ccb->csio.sense_data, min(io->scsiio.sense_len, ccb->csio.sense_len)); @@ -486,14 +488,18 @@ cfcs_done(union ctl_io *io) } break; case CTL_CMD_ABORTED: - ccb->ccb_h.status = CAM_REQ_ABORTED; + ccb->ccb_h.status |= CAM_REQ_ABORTED; break; case CTL_ERROR: default: - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + ccb->ccb_h.status |= CAM_REQ_CMP_ERR; break; } - + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP && + (ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); + ccb->ccb_h.status |= CAM_DEV_QFRZN; + } xpt_done(ccb); ctl_free_io(io); }