Skip to content

Instantly share code, notes, and snippets.

@ctuffli
Created March 5, 2012 22:44
Show Gist options
  • Save ctuffli/1981701 to your computer and use it in GitHub Desktop.
Save ctuffli/1981701 to your computer and use it in GitHub Desktop.
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 7a36509..d2595b5 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -9353,8 +9353,16 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio)
if (lun != NULL)
inq_ptr->device = (SID_QUAL_LU_CONNECTED << 5) |
lun->be_lun->lun_type;
- else
- inq_ptr->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT;
+ else {
+ free(ctsio->kern_data_ptr, M_CTL);
+
+ // TODO cft - probably can do better than "not ready"
+ ctl_set_lun_not_ready(ctsio);
+ ctsio->io_hdr.status = CTL_SCSI_ERROR;
+ ctsio->scsi_status = SCSI_STATUS_CHECK_COND;
+ ctl_done((union ctl_io *)ctsio);
+ return (CTL_RETVAL_COMPLETE);
+ }
/* RMB in byte 2 is 0 */
inq_ptr->version = SCSI_REV_SPC3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment