svn commit: r250948 - stable/9/sys/cam

Scott Long scottl at FreeBSD.org
Thu May 23 22:48:41 UTC 2013


Author: scottl
Date: Thu May 23 22:48:40 2013
New Revision: 250948
URL: http://svnweb.freebsd.org/changeset/base/250948

Log:
  MFC 248501:
  
  Assert that a ccb passed to cam_periph_mapmem() for XPT_SCSI_IO and
  XPT_ATA_IO holds virtual buffer address.
  
  Submitted by:	kib
  Obtained from:	Netflix

Modified:
  stable/9/sys/cam/cam_periph.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/cam_periph.c
==============================================================================
--- stable/9/sys/cam/cam_periph.c	Thu May 23 22:45:58 2013	(r250947)
+++ stable/9/sys/cam/cam_periph.c	Thu May 23 22:48:40 2013	(r250948)
@@ -733,6 +733,8 @@ cam_periph_mapmem(union ccb *ccb, struct
 	case XPT_CONT_TARGET_IO:
 		if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
 			return(0);
+		KASSERT((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR,
+		    ("not VADDR for SCSI_IO %p %x\n", ccb, ccb->ccb_h.flags));
 
 		data_ptrs[0] = &ccb->csio.data_ptr;
 		lengths[0] = ccb->csio.dxfer_len;
@@ -742,6 +744,8 @@ cam_periph_mapmem(union ccb *ccb, struct
 	case XPT_ATA_IO:
 		if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE)
 			return(0);
+		KASSERT((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR,
+		    ("not VADDR for ATA_IO %p %x\n", ccb, ccb->ccb_h.flags));
 
 		data_ptrs[0] = &ccb->ataio.data_ptr;
 		lengths[0] = ccb->ataio.dxfer_len;


More information about the svn-src-all mailing list