From 1ff51ec98e5e55d08e3db171acbee46f120d7b0d Mon Sep 17 00:00:00 2001 From: mav Date: Mon, 28 Sep 2015 12:30:22 +0000 Subject: [PATCH] MFC r287289: Attach pass driver to LUNs is OFFLINE state. Previously such LUNs were silently ignored. But while they indeed unable to process most of SCSI commands, some, like RTPG, they still can. git-svn-id: svn://svn.freebsd.org/base/stable/10@288338 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/cam/ata/ata_xpt.c | 3 ++- sys/cam/scsi/scsi_cd.c | 3 ++- sys/cam/scsi/scsi_ch.c | 3 ++- sys/cam/scsi/scsi_da.c | 3 ++- sys/cam/scsi/scsi_pt.c | 3 ++- sys/cam/scsi/scsi_sa.c | 3 ++- sys/cam/scsi/scsi_xpt.c | 11 ++++++----- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index a442ec15c..3429bb29a 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -1090,7 +1090,8 @@ device_fail: if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) periph_qual = SID_QUAL(inq_buf); - if (periph_qual != SID_QUAL_LU_CONNECTED) + if (periph_qual != SID_QUAL_LU_CONNECTED && + periph_qual != SID_QUAL_LU_OFFLINE) break; /* diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index 47f27288a..16acd6dce 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -392,7 +392,8 @@ cdasync(void *callback_arg, u_int32_t code, if (cgd->protocol != PROTO_SCSI) break; - + if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED) + break; if (SID_TYPE(&cgd->inq_data) != T_CDROM && SID_TYPE(&cgd->inq_data) != T_WORM) break; diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c index b83bc53f0..38acb0197 100644 --- a/sys/cam/scsi/scsi_ch.c +++ b/sys/cam/scsi/scsi_ch.c @@ -337,7 +337,8 @@ chasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) if (cgd->protocol != PROTO_SCSI) break; - + if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED) + break; if (SID_TYPE(&cgd->inq_data)!= T_CHANGER) break; diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index fe629e03a..3266301fa 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -1667,7 +1667,8 @@ daasync(void *callback_arg, u_int32_t code, if (cgd->protocol != PROTO_SCSI) break; - + if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED) + break; if (SID_TYPE(&cgd->inq_data) != T_DIRECT && SID_TYPE(&cgd->inq_data) != T_RBC && SID_TYPE(&cgd->inq_data) != T_OPTICAL) diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c index f34748c3c..15240da32 100644 --- a/sys/cam/scsi/scsi_pt.c +++ b/sys/cam/scsi/scsi_pt.c @@ -366,7 +366,8 @@ ptasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) if (cgd->protocol != PROTO_SCSI) break; - + if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED) + break; if (SID_TYPE(&cgd->inq_data) != T_PROCESSOR) break; diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c index 0480854ea..d0a2811db 100644 --- a/sys/cam/scsi/scsi_sa.c +++ b/sys/cam/scsi/scsi_sa.c @@ -2254,7 +2254,8 @@ saasync(void *callback_arg, u_int32_t code, if (cgd->protocol != PROTO_SCSI) break; - + if (SID_QUAL(&cgd->inq_data) != SID_QUAL_LU_CONNECTED) + break; if (SID_TYPE(&cgd->inq_data) != T_SEQUENTIAL) break; diff --git a/sys/cam/scsi/scsi_xpt.c b/sys/cam/scsi/scsi_xpt.c index 57bcfb268..767aa0d04 100644 --- a/sys/cam/scsi/scsi_xpt.c +++ b/sys/cam/scsi/scsi_xpt.c @@ -1126,6 +1126,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) { probe_softc *softc; struct cam_path *path; + struct scsi_inquiry_data *inq_buf; u_int32_t priority; CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probedone\n")); @@ -1165,7 +1166,6 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) case PROBE_FULL_INQUIRY: { if (cam_ccb_status(done_ccb) == CAM_REQ_CMP) { - struct scsi_inquiry_data *inq_buf; u_int8_t periph_qual; path->device->flags |= CAM_DEV_INQUIRY_DATA_VALID; @@ -1174,7 +1174,8 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) periph_qual = SID_QUAL(inq_buf); - if (periph_qual == SID_QUAL_LU_CONNECTED) { + if (periph_qual == SID_QUAL_LU_CONNECTED || + periph_qual == SID_QUAL_LU_OFFLINE) { u_int8_t len; /* @@ -1350,10 +1351,10 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) probe_purge_old(path, lp, softc->flags); lp = NULL; } + inq_buf = &path->device->inq_data; if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID && - SID_QUAL(&path->device->inq_data) == SID_QUAL_LU_CONNECTED) { - struct scsi_inquiry_data *inq_buf; - inq_buf = &path->device->inq_data; + (SID_QUAL(inq_buf) == SID_QUAL_LU_CONNECTED || + SID_QUAL(inq_buf) == SID_QUAL_LU_OFFLINE)) { if (INQ_DATA_TQ_ENABLED(inq_buf)) PROBE_SET_ACTION(softc, PROBE_MODE_SENSE); else -- 2.45.0