Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Jan 2012 00:34:19 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r230692 - in stable/8/sys/dev: isp mps mpt
Message-ID:  <201201290034.q0T0YJ9a007033@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Sun Jan 29 00:34:19 2012
New Revision: 230692
URL: http://svn.freebsd.org/changeset/base/230692

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

Modified:
  stable/8/sys/dev/isp/isp_freebsd.h
  stable/8/sys/dev/mps/mps_sas.c
  stable/8/sys/dev/mpt/mpt_cam.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/isp/isp_freebsd.h
==============================================================================
--- stable/8/sys/dev/isp/isp_freebsd.h	Sun Jan 29 00:32:37 2012	(r230691)
+++ stable/8/sys/dev/isp/isp_freebsd.h	Sun Jan 29 00:34:19 2012	(r230692)
@@ -473,6 +473,7 @@ default:							\
 
 #define	XS_SAVE_SENSE(xs, sense_ptr, sense_len)		\
 	(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), sense_len))
 
 #define	XS_SENSE_VALID(xs)	(((xs)->ccb_h.status & CAM_AUTOSNS_VALID) != 0)

Modified: stable/8/sys/dev/mps/mps_sas.c
==============================================================================
--- stable/8/sys/dev/mps/mps_sas.c	Sun Jan 29 00:32:37 2012	(r230691)
+++ stable/8/sys/dev/mps/mps_sas.c	Sun Jan 29 00:34:19 2012	(r230692)
@@ -1670,6 +1670,7 @@ mpssas_scsiio_complete(struct mps_softc 
 		    sizeof(struct scsi_sense_data));
 		if (sense_len < rep->SenseCount)
 			ccb->csio.sense_resid = rep->SenseCount - sense_len;
+		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/8/sys/dev/mpt/mpt_cam.c
==============================================================================
--- stable/8/sys/dev/mpt/mpt_cam.c	Sun Jan 29 00:32:37 2012	(r230691)
+++ stable/8/sys/dev/mpt/mpt_cam.c	Sun Jan 29 00:34:19 2012	(r230692)
@@ -3170,6 +3170,7 @@ mpt_scsi_reply_frame_handler(struct mpt_
 		ccb->ccb_h.status |= CAM_AUTOSNS_VALID;
 		ccb->csio.sense_resid =
 		    ccb->csio.sense_len - le32toh(scsi_io_reply->SenseCount);
+		bzero(&ccb->csio.sense_data, sizeof(&ccb->csio.sense_data));
 		bcopy(req->sense_vbuf, &ccb->csio.sense_data,
 		    min(ccb->csio.sense_len,
 		    le32toh(scsi_io_reply->SenseCount)));



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