diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1888,13 +1888,31 @@ /* Filter the errors that should be reported via devctl */ switch (ccb->ccb_h.status & CAM_STATUS_MASK) { + case CAM_SCSI_STATUS_ERROR: { + int serr, sk, asc, ascq; + + if (scsi_extract_sense_ccb(ccb, &serr, &sk, &asc, &ascq) && + sk == SSD_KEY_ILLEGAL_REQUEST) { + /* + * Don't log illegal requests. These are often used to + * probe what a drive can do, often by programs like + * smartctl that lose this knowledge from run to run. + * It doesn't seem useful to assess the health or other + * characteristics of a specific drive. We can't spike + * the error (the caller needs to see it), so we have + * to do this off filtering here. + */ + break; + } + devctl_err++; + break; + } case CAM_CMD_TIMEOUT: case CAM_REQ_ABORTED: case CAM_REQ_CMP_ERR: case CAM_REQ_TERMIO: case CAM_UNREC_HBA_ERROR: case CAM_DATA_RUN_ERR: - case CAM_SCSI_STATUS_ERROR: case CAM_ATA_STATUS_ERROR: case CAM_SMP_STATUS_ERROR: case CAM_DEV_NOT_THERE: