mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-18 15:30:21 +00:00
Do not pretend to have autosense data when no such data is available.
Make umass return an error code if SCSI sense retrieval request has failed. Make sure scsi_error_action honors SF_NO_RETRY and SF_NO_RECOVERY in all cases, even if it cannot parse sense bytes. Reviewed by: hselasky (umass), scottl (cam)
This commit is contained in:
parent
850e744187
commit
e15f85e71c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245647
@ -3071,16 +3071,15 @@ scsi_error_action(struct ccb_scsiio *csio, struct scsi_inquiry_data *inq_data,
|
||||
SSQ_PRINT_SENSE;
|
||||
}
|
||||
}
|
||||
if ((action & SS_MASK) >= SS_START &&
|
||||
(sense_flags & SF_NO_RECOVERY)) {
|
||||
action &= ~SS_MASK;
|
||||
action |= SS_FAIL;
|
||||
} else if ((action & SS_MASK) == SS_RETRY &&
|
||||
(sense_flags & SF_NO_RETRY)) {
|
||||
action &= ~SS_MASK;
|
||||
action |= SS_FAIL;
|
||||
}
|
||||
|
||||
}
|
||||
if ((action & SS_MASK) >= SS_START &&
|
||||
(sense_flags & SF_NO_RECOVERY)) {
|
||||
action &= ~SS_MASK;
|
||||
action |= SS_FAIL;
|
||||
} else if ((action & SS_MASK) == SS_RETRY &&
|
||||
(sense_flags & SF_NO_RETRY)) {
|
||||
action &= ~SS_MASK;
|
||||
action |= SS_FAIL;
|
||||
}
|
||||
if ((sense_flags & SF_PRINT_ALWAYS) != 0)
|
||||
action |= SSQ_PRINT_SENSE;
|
||||
|
@ -2602,9 +2602,13 @@ umass_cam_sense_cb(struct umass_softc *sc, union ccb *ccb, uint32_t residue,
|
||||
}
|
||||
} else {
|
||||
xpt_freeze_devq(ccb->ccb_h.path, 1);
|
||||
ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR
|
||||
| CAM_AUTOSNS_VALID | CAM_DEV_QFRZN;
|
||||
ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND;
|
||||
if (key >= 0) {
|
||||
ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR
|
||||
| CAM_AUTOSNS_VALID | CAM_DEV_QFRZN;
|
||||
ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND;
|
||||
} else
|
||||
ccb->ccb_h.status = CAM_AUTOSENSE_FAIL
|
||||
| CAM_DEV_QFRZN;
|
||||
}
|
||||
xpt_done(ccb);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user