Date: Sun, 26 Feb 2017 12:54:27 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314300 - head/sys/cam/ctl Message-ID: <201702261254.v1QCsRHP008397@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sun Feb 26 12:54:27 2017 New Revision: 314300 URL: https://svnweb.freebsd.org/changeset/base/314300 Log: Use resid field of CTIO to detect under/overruns. 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 Sun Feb 26 12:52:44 2017 (r314299) +++ head/sys/cam/ctl/scsi_ctl.c Sun Feb 26 12:54:27 2017 (r314300) @@ -1253,7 +1253,8 @@ ctlfedone(struct cam_periph *periph, uni */ switch (done_ccb->ccb_h.status & CAM_STATUS_MASK) { case CAM_REQ_CMP: - io->scsiio.kern_data_resid -= csio->dxfer_len; + io->scsiio.kern_data_resid -= + csio->dxfer_len - csio->resid; io->io_hdr.port_status = 0; break; default: @@ -1280,8 +1281,8 @@ ctlfedone(struct cam_periph *periph, uni * pieces, figure out where we are in the list, and * continue sending pieces if necessary. */ - if ((cmd_info->flags & CTLFE_CMD_PIECEWISE) - && (io->io_hdr.port_status == 0)) { + if ((cmd_info->flags & CTLFE_CMD_PIECEWISE) && + io->io_hdr.port_status == 0 && csio->resid == 0) { ccb_flags flags; uint8_t *data_ptr; uint32_t dxfer_len;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702261254.v1QCsRHP008397>