summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbg159949 <none@none>2005-09-27 10:10:29 -0700
committerbg159949 <none@none>2005-09-27 10:10:29 -0700
commitf5689c9e46e7cb51a510fa3869980072b92ea528 (patch)
treec9e91cf101d9572b43bd52243287995277b2f816
parent57e22c6cd28a5d6515e45e300d346e66d9b0c2b7 (diff)
downloadillumos-joyent-f5689c9e46e7cb51a510fa3869980072b92ea528.tar.gz
4670329 warlock problems
6290788 kernel may panic if SCSI device serial number is not available
-rwxr-xr-xusr/src/common/devid/devid_scsi.c4
-rw-r--r--usr/src/uts/common/io/scsi/targets/sd.c8
-rw-r--r--usr/src/uts/common/sys/scsi/targets/sddef.h4
3 files changed, 15 insertions, 1 deletions
diff --git a/usr/src/common/devid/devid_scsi.c b/usr/src/common/devid/devid_scsi.c
index dd19c1caf5..8771d80ab7 100755
--- a/usr/src/common/devid/devid_scsi.c
+++ b/usr/src/common/devid/devid_scsi.c
@@ -952,7 +952,9 @@ encode_serialnum(int version, uchar_t *inq, uchar_t *inq80,
*/
if (*id_len == (size_t)inq80[3]) {
/* empty unit serial number */
- DEVID_FREE(*id, *id_len);
+ if (*id != NULL) {
+ DEVID_FREE(*id, *id_len);
+ }
*id = NULL;
*id_len = 0;
}
diff --git a/usr/src/uts/common/io/scsi/targets/sd.c b/usr/src/uts/common/io/scsi/targets/sd.c
index edc295ea7a..8f6e9665cb 100644
--- a/usr/src/uts/common/io/scsi/targets/sd.c
+++ b/usr/src/uts/common/io/scsi/targets/sd.c
@@ -1055,7 +1055,9 @@ static void sd_scsi_clear_probe_cache(void);
static int sd_scsi_probe_with_cache(struct scsi_device *devp, int (*fn)());
static int sd_spin_up_unit(struct sd_lun *un);
+#ifdef _LP64
static void sd_enable_descr_sense(struct sd_lun *un);
+#endif /* _LP64 */
static void sd_set_mmc_caps(struct sd_lun *un);
static void sd_read_unit_properties(struct sd_lun *un);
@@ -1198,8 +1200,10 @@ static int sd_setup_rw_pkt(struct sd_lun *un, struct scsi_pkt **pktpp,
struct buf *bp, int flags,
int (*callback)(caddr_t), caddr_t callback_arg,
diskaddr_t lba, uint32_t blockcount);
+#if defined(__i386) || defined(__amd64)
static int sd_setup_next_rw_pkt(struct sd_lun *un, struct scsi_pkt *pktp,
struct buf *bp, diskaddr_t lba, uint32_t blockcount);
+#endif /* defined(__i386) || defined(__amd64) */
/*
* Prototypes for functions to support USCSI IO.
@@ -2818,6 +2822,7 @@ sd_spin_up_unit(struct sd_lun *un)
return (0);
}
+#ifdef _LP64
/*
* Function: sd_enable_descr_sense
*
@@ -2891,6 +2896,7 @@ sd_enable_descr_sense(struct sd_lun *un)
eds_exit:
kmem_free(header, buflen);
}
+#endif /* _LP64 */
/*
@@ -13220,6 +13226,7 @@ sd_setup_rw_pkt(struct sd_lun *un,
return (SD_PKT_ALLOC_FAILURE_CDB_TOO_SMALL);
}
+#if defined(__i386) || defined(__amd64)
/*
* Function: sd_setup_next_rw_pkt
*
@@ -13295,6 +13302,7 @@ sd_setup_next_rw_pkt(struct sd_lun *un,
*/
return (SD_PKT_ALLOC_FAILURE);
}
+#endif /* defined(__i386) || defined(__amd64) */
/*
* Function: sd_initpkt_for_uscsi
diff --git a/usr/src/uts/common/sys/scsi/targets/sddef.h b/usr/src/uts/common/sys/scsi/targets/sddef.h
index 59582746ef..bec196d0ae 100644
--- a/usr/src/uts/common/sys/scsi/targets/sddef.h
+++ b/usr/src/uts/common/sys/scsi/targets/sddef.h
@@ -634,6 +634,10 @@ struct sd_lun {
_NOTE(MUTEX_PROTECTS_DATA(scsi_device::sd_mutex, sd_lun))
_NOTE(READ_ONLY_DATA(sd_lun::un_sd))
_NOTE(DATA_READABLE_WITHOUT_LOCK(sd_lun::un_reservation_type))
+_NOTE(DATA_READABLE_WITHOUT_LOCK(sd_lun::un_pm_capable_prop))
+_NOTE(DATA_READABLE_WITHOUT_LOCK(sd_lun::un_mincdb))
+_NOTE(DATA_READABLE_WITHOUT_LOCK(sd_lun::un_maxcdb))
+_NOTE(DATA_READABLE_WITHOUT_LOCK(sd_lun::un_status_len))
#if defined(__i386) || defined(__amd64)