svn commit: r226303 - in stable/9/sys/dev: isp mps mpt

Marius Strobl marius at FreeBSD.org
Wed Oct 12 15:02:07 UTC 2011


Author: marius
Date: Wed Oct 12 15:02:06 2011
New Revision: 226303
URL: http://svn.freebsd.org/changeset/base/226303

Log:
  MFC r226118:
  
  Sync with ahc(4)/ahd(4)/sym(4) etc:
  Zero any sense not transferred by the device as the SCSI specification
  mandates that any untransferred data should be assumed to be zero.
  
  Reviewed by:	ken
  Approved by:	re (kib)

Modified:
  stable/9/sys/dev/isp/isp_freebsd.h
  stable/9/sys/dev/mps/mps_sas.c
  stable/9/sys/dev/mpt/mpt_cam.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/isp/isp_freebsd.h
==============================================================================
--- stable/9/sys/dev/isp/isp_freebsd.h	Wed Oct 12 14:13:32 2011	(r226302)
+++ stable/9/sys/dev/isp/isp_freebsd.h	Wed Oct 12 15:02:06 2011	(r226303)
@@ -486,6 +486,7 @@ default:							\
 
 #define	XS_SAVE_SENSE(xs, sense_ptr, slen)	do {			\
 		(xs)->ccb_h.status |= CAM_AUTOSNS_VALID;		\
+		memset(&(xs)->sense_data, 0, sizeof(&(xs)->sense_data));\
 		memcpy(&(xs)->sense_data, sense_ptr, imin(XS_SNSLEN(xs),\
 		       slen)); 						\
 		if (slen < (xs)->sense_len) 				\

Modified: stable/9/sys/dev/mps/mps_sas.c
==============================================================================
--- stable/9/sys/dev/mps/mps_sas.c	Wed Oct 12 14:13:32 2011	(r226302)
+++ stable/9/sys/dev/mps/mps_sas.c	Wed Oct 12 15:02:06 2011	(r226303)
@@ -1675,6 +1675,7 @@ mpssas_scsiio_complete(struct mps_softc 
 
 		sense_len = min(rep->SenseCount, ccb->csio.sense_len -
 		    ccb->csio.sense_resid);
+		bzero(&ccb->csio.sense_data, sizeof(&ccb->csio.sense_data));
 		bcopy(cm->cm_sense, &ccb->csio.sense_data, sense_len);
 		ccb->ccb_h.status |= CAM_AUTOSNS_VALID;
 	}

Modified: stable/9/sys/dev/mpt/mpt_cam.c
==============================================================================
--- stable/9/sys/dev/mpt/mpt_cam.c	Wed Oct 12 14:13:32 2011	(r226302)
+++ stable/9/sys/dev/mpt/mpt_cam.c	Wed Oct 12 15:02:06 2011	(r226303)
@@ -3178,6 +3178,7 @@ mpt_scsi_reply_frame_handler(struct mpt_
 		else
 			ccb->csio.sense_resid = 0;
 
+		bzero(&ccb->csio.sense_data, sizeof(&ccb->csio.sense_data));
 		bcopy(req->sense_vbuf, &ccb->csio.sense_data,
 		    min(ccb->csio.sense_len, sense_returned));
 	}


More information about the svn-src-stable-9 mailing list