Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jan 2015 09:05:43 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r277919 - stable/10/sys/cam/ctl
Message-ID:  <201501300905.t0U95hSP000407@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Fri Jan 30 09:05:43 2015
New Revision: 277919
URL: https://svnweb.freebsd.org/changeset/base/277919

Log:
  MFC r277247: Don't count status as sent until CTIO completes successfully.
  
  If we aggregated status sending with data move and got error, allow status
  to be updated and resent again separately.  Without this command may stuck
  without status sent at all.

Modified:
  stable/10/sys/cam/ctl/scsi_ctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cam/ctl/scsi_ctl.c
==============================================================================
--- stable/10/sys/cam/ctl/scsi_ctl.c	Fri Jan 30 09:04:20 2015	(r277918)
+++ stable/10/sys/cam/ctl/scsi_ctl.c	Fri Jan 30 09:05:43 2015	(r277919)
@@ -891,7 +891,6 @@ ctlfestart(struct cam_periph *periph, un
 	    (cmd_info->flags & CTLFE_CMD_PIECEWISE) == 0 &&
 	    ((io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) == 0 ||
 	     io->io_hdr.status == CTL_SUCCESS)) {
-		io->io_hdr.flags |= CTL_FLAG_STATUS_SENT;
 		flags |= CAM_SEND_STATUS;
 		scsi_status = io->scsiio.scsi_status;
 		csio->sense_len = io->scsiio.sense_len;
@@ -1265,6 +1264,10 @@ ctlfedone(struct cam_periph *periph, uni
 			break;
 		}
 
+		if ((done_ccb->ccb_h.flags & CAM_SEND_STATUS) &&
+		    (done_ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)
+			io->io_hdr.flags |= CTL_FLAG_STATUS_SENT;
+
 		/*
 		 * If we were sending status back to the initiator, free up
 		 * resources.  If we were doing a datamove, call the



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501300905.t0U95hSP000407>