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
This commit is contained in:
parent
4795003bd2
commit
50e66535b9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=226118
@ -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) \
|
||||
|
@ -1675,6 +1675,7 @@ mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm)
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -3178,6 +3178,7 @@ mpt_scsi_reply_frame_handler(struct mpt_softc *mpt, request_t *req,
|
||||
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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user