Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Oct 2014 16:15:32 +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: r273046 - head/sys/cam/ctl
Message-ID:  <201410131615.s9DGFWYf027203@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Oct 13 16:15:32 2014
New Revision: 273046
URL: https://svnweb.freebsd.org/changeset/base/273046

Log:
  Don't confuse frontend with zero length data moves, just return immediately.
  
  MFC after:	1 week

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Mon Oct 13 16:12:28 2014	(r273045)
+++ head/sys/cam/ctl/ctl.c	Mon Oct 13 16:15:32 2014	(r273046)
@@ -10821,15 +10821,9 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio
 	}
 
 	ctsio->scsi_status = SCSI_STATUS_OK;
-	if (ctsio->kern_data_len > 0) {
-		ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
-		ctsio->be_move_done = ctl_config_move_done;
-		ctl_datamove((union ctl_io *)ctsio);
-	} else {
-		ctsio->io_hdr.status = CTL_SUCCESS;
-		ctl_done((union ctl_io *)ctsio);
-	}
-
+	ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
+	ctsio->be_move_done = ctl_config_move_done;
+	ctl_datamove((union ctl_io *)ctsio);
 	return (CTL_RETVAL_COMPLETE);
 }
 
@@ -12901,6 +12895,12 @@ ctl_datamove(union ctl_io *io)
 		return;
 	}
 
+	/* Don't confuse frontend with zero length data move. */
+	if (io->scsiio.kern_data_len == 0) {
+		io->scsiio.be_move_done(io);
+		return;
+	}
+
 	/*
 	 * If we're in XFER mode and this I/O is from the other shelf
 	 * controller, we need to send the DMA to the other side to



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