summaryrefslogtreecommitdiff
path: root/usr/src/uts
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2017-03-06 13:07:55 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2017-03-06 13:07:55 +0000
commitcedddd0bb5c808632ca226e9f66ab136098d1b2c (patch)
tree971adb1381c693aa122361817677be4dc3cb3d50 /usr/src/uts
parent91d2d9664188336e93786a92761888d1e299c88f (diff)
parent015408caf0806500740413126a0215c7493f4bdf (diff)
downloadillumos-joyent-cedddd0bb5c808632ca226e9f66ab136098d1b2c.tar.gz
[illumos-gate merge]
commit 015408caf0806500740413126a0215c7493f4bdf 7934 sa_init() should use multi-threaded errno commit 25d3556849fcbe4fe5d517e1add48e0b2d585c70 7933 libcfgadm: memory leak in do_list_common() commit 89ac1330de393e78c8b27c33453223b10d3c18da 7932 cfgadm_plugins/shp: memory leaks in cfga_list_ext() commit 39b16bd33a2633978bee6aed53e3afeb26399eb4 7840 Define uint16_t member in in6_addr commit e1508819051004d7be493a04ee515905ae412142 6899 coverity problems in localedef commit 8241ccbb39665a24ebedcca509f82ef3f0b6dd83 6470 mac_unregister() needs to mod_hash_remove() BEFORE holding the perimeter. commit 6e28b3a925501ed4b842fd8e877e8a89989a4c5c 7897 loader.efi: Use 32-bit value for .text padding, for linker portability commit e3ed3d332db66cf933650481f47832aaadb70ec3 7862 libdisasm: left shift of negative value commit a536a2a3182b56eef2630fb4b4509c9e106655e6 7722 bootblock versioning needs to deal with missing data commit baa708d63390757ca1a97444649f2fe4d3ae98f0 7926 enable gcc warnings for sd Conflicts: usr/src/uts/common/io/scsi/targets/sd.c
Diffstat (limited to 'usr/src/uts')
-rw-r--r--usr/src/uts/common/io/mac/mac_provider.c17
-rw-r--r--usr/src/uts/common/io/scsi/targets/sd.c203
-rw-r--r--usr/src/uts/common/io/scsi/targets/sd_xbuf.c7
-rw-r--r--usr/src/uts/common/netinet/in.h3
-rw-r--r--usr/src/uts/i86pc/i86hvm/hvm_sd/Makefile7
-rw-r--r--usr/src/uts/intel/sd/Makefile7
-rw-r--r--usr/src/uts/sparc/sd/Makefile7
7 files changed, 113 insertions, 138 deletions
diff --git a/usr/src/uts/common/io/mac/mac_provider.c b/usr/src/uts/common/io/mac/mac_provider.c
index 98b770786a..beb63937ed 100644
--- a/usr/src/uts/common/io/mac/mac_provider.c
+++ b/usr/src/uts/common/io/mac/mac_provider.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2015, Joyent, Inc.
+ * Copyright 2017 OmniTI Computer Consulting, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -518,6 +519,18 @@ mac_unregister(mac_handle_t mh)
*/
i_mac_notify_exit(mip);
+ /*
+ * Prior to acquiring the MAC perimeter, remove the MAC instance from
+ * the internal hash table. Such removal means table-walkers that
+ * acquire the perimeter will not do so on behalf of what we are
+ * unregistering, which prevents a deadlock.
+ */
+ rw_enter(&i_mac_impl_lock, RW_WRITER);
+ (void) mod_hash_remove(i_mac_impl_hash,
+ (mod_hash_key_t)mip->mi_name, &val);
+ rw_exit(&i_mac_impl_lock);
+ ASSERT(mip == (mac_impl_t *)val);
+
i_mac_perim_enter(mip);
/*
@@ -537,10 +550,6 @@ mac_unregister(mac_handle_t mh)
mac_driver_stat_delete(mip);
- (void) mod_hash_remove(i_mac_impl_hash,
- (mod_hash_key_t)mip->mi_name, &val);
- ASSERT(mip == (mac_impl_t *)val);
-
ASSERT(i_mac_impl_count > 0);
atomic_dec_32(&i_mac_impl_count);
diff --git a/usr/src/uts/common/io/scsi/targets/sd.c b/usr/src/uts/common/io/scsi/targets/sd.c
index f0864d98b0..bf0f2dca12 100644
--- a/usr/src/uts/common/io/scsi/targets/sd.c
+++ b/usr/src/uts/common/io/scsi/targets/sd.c
@@ -1252,7 +1252,6 @@ static void sd_register_devid(sd_ssc_t *ssc, dev_info_t *devi,
static int sd_get_devid(sd_ssc_t *ssc);
static ddi_devid_t sd_create_devid(sd_ssc_t *ssc);
static int sd_write_deviceid(sd_ssc_t *ssc);
-static int sd_get_devid_page(struct sd_lun *un, uchar_t *wwn, int *len);
static int sd_check_vpd_page_support(sd_ssc_t *ssc);
static void sd_setup_pm(sd_ssc_t *ssc, dev_info_t *devi);
@@ -1638,15 +1637,15 @@ static void sd_check_for_writable_cd(sd_ssc_t *ssc, int path_flag);
static int sd_wm_cache_constructor(void *wm, void *un, int flags);
static void sd_wm_cache_destructor(void *wm, void *un);
static struct sd_w_map *sd_range_lock(struct sd_lun *un, daddr_t startb,
- daddr_t endb, ushort_t typ);
+ daddr_t endb, ushort_t typ);
static struct sd_w_map *sd_get_range(struct sd_lun *un, daddr_t startb,
- daddr_t endb);
+ daddr_t endb);
static void sd_free_inlist_wmap(struct sd_lun *un, struct sd_w_map *wmp);
static void sd_range_unlock(struct sd_lun *un, struct sd_w_map *wm);
static void sd_read_modify_write_task(void * arg);
static int
sddump_do_read_of_rmw(struct sd_lun *un, uint64_t blkno, uint64_t nblk,
- struct buf **bpp);
+ struct buf **bpp);
/*
@@ -2885,7 +2884,7 @@ sdinfo(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result)
static int
sd_prop_op(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op, int mod_flags,
- char *name, caddr_t valuep, int *lengthp)
+ char *name, caddr_t valuep, int *lengthp)
{
struct sd_lun *un;
@@ -5012,7 +5011,7 @@ sd_is_lsi(struct sd_lun *un)
static int
sd_get_physical_geometry(struct sd_lun *un, cmlb_geom_t *pgeom_p,
- diskaddr_t capacity, int lbasize, int path_flag)
+ diskaddr_t capacity, int lbasize, int path_flag)
{
struct mode_format *page3p;
struct mode_geometry *page4p;
@@ -6705,12 +6704,12 @@ sdpower(dev_info_t *devi, int component, int level)
int medium_present;
time_t intvlp;
struct pm_trans_data sd_pm_tran_data;
- uchar_t save_state;
+ uchar_t save_state = SD_STATE_NORMAL;
int sval, tursval;
uchar_t state_before_pm;
int got_semaphore_here;
sd_ssc_t *ssc;
- int last_power_level;
+ int last_power_level = SD_SPINDLE_UNINIT;
instance = ddi_get_instance(devi);
@@ -8497,8 +8496,6 @@ sd_unit_attach(dev_info_t *devi)
*/
wm_cache_failed:
devid_failed:
-
-setup_pm_failed:
ddi_remove_minor_node(devi, NULL);
cmlb_attach_failed:
@@ -8617,8 +8614,6 @@ create_errstats_failed:
sema_destroy(&un->un_semoclose);
cv_destroy(&un->un_state_cv);
-getrbuf_failed:
-
sd_free_rqs(un);
alloc_rqs_failed:
@@ -8626,7 +8621,6 @@ alloc_rqs_failed:
devp->sd_private = NULL;
bzero(un, sizeof (struct sd_lun)); /* Clear any stale data! */
-get_softstate_failed:
/*
* Note: the man pages are unclear as to whether or not doing a
* ddi_soft_state_free(sd_state, instance) is the right way to
@@ -11657,7 +11651,7 @@ sd_xbuf_strategy(struct buf *bp, ddi_xbuf_t xp, void *arg)
static void
sd_xbuf_init(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
- uchar_t chain_type, void *pktinfop)
+ uchar_t chain_type, void *pktinfop)
{
int index;
@@ -11891,7 +11885,7 @@ sd_uscsi_strategy(struct buf *bp)
static int
sd_send_scsi_cmd(dev_t dev, struct uscsi_cmd *incmd, int flag,
- enum uio_seg dataspace, int path_flag)
+ enum uio_seg dataspace, int path_flag)
{
struct sd_lun *un;
sd_ssc_t *ssc;
@@ -12061,7 +12055,7 @@ sd_ssc_fini(sd_ssc_t *ssc)
*/
static int
sd_ssc_send(sd_ssc_t *ssc, struct uscsi_cmd *incmd, int flag,
- enum uio_seg dataspace, int path_flag)
+ enum uio_seg dataspace, int path_flag)
{
struct sd_uscsi_info *uip;
struct uscsi_cmd *uscmd;
@@ -14447,8 +14441,8 @@ sd_destroypkt_for_uscsi(struct buf *bp)
*/
static struct buf *
-sd_bioclone_alloc(struct buf *bp, size_t datalen,
- daddr_t blkno, int (*func)(struct buf *))
+sd_bioclone_alloc(struct buf *bp, size_t datalen, daddr_t blkno,
+ int (*func)(struct buf *))
{
struct sd_lun *un;
struct sd_xbuf *xp;
@@ -14507,7 +14501,7 @@ sd_bioclone_alloc(struct buf *bp, size_t datalen,
static struct buf *
sd_shadow_buf_alloc(struct buf *bp, size_t datalen, uint_t bflags,
- daddr_t blkno, int (*func)(struct buf *))
+ daddr_t blkno, int (*func)(struct buf *))
{
struct sd_lun *un;
struct sd_xbuf *xp;
@@ -14664,7 +14658,7 @@ sd_shadow_buf_free(struct buf *bp)
static void
sd_print_transport_rejected_message(struct sd_lun *un, struct sd_xbuf *xp,
- int code)
+ int code)
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -15623,7 +15617,7 @@ sd_return_failed_command(struct sd_lun *un, struct buf *bp, int errcode)
static void
sd_return_failed_command_no_restart(struct sd_lun *un, struct buf *bp,
- int errcode)
+ int errcode)
{
struct sd_xbuf *xp;
@@ -15734,9 +15728,9 @@ sd_return_failed_command_no_restart(struct sd_lun *un, struct buf *bp,
static void
sd_retry_command(struct sd_lun *un, struct buf *bp, int retry_check_flag,
- void (*user_funcp)(struct sd_lun *un, struct buf *bp, void *argp, int
- code), void *user_arg, int failure_code, clock_t retry_delay,
- void (*statp)(kstat_io_t *))
+ void (*user_funcp)(struct sd_lun *un, struct buf *bp, void *argp, int code),
+ void *user_arg, int failure_code, clock_t retry_delay,
+ void (*statp)(kstat_io_t *))
{
struct sd_xbuf *xp;
struct scsi_pkt *pktp;
@@ -16100,7 +16094,7 @@ fail_command_no_log:
static void
sd_set_retry_bp(struct sd_lun *un, struct buf *bp, clock_t retry_delay,
- void (*statp)(kstat_io_t *))
+ void (*statp)(kstat_io_t *))
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -16351,7 +16345,7 @@ sd_start_direct_priority_command(void *arg)
static void
sd_send_request_sense_command(struct sd_lun *un, struct buf *bp,
- struct scsi_pkt *pktp)
+ struct scsi_pkt *pktp)
{
ASSERT(bp != NULL);
ASSERT(un != NULL);
@@ -17398,7 +17392,7 @@ sd_print_incomplete_msg(struct sd_lun *un, struct buf *bp, void *arg, int code)
static void
sd_pkt_status_good(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
char *cmdp;
@@ -17458,7 +17452,7 @@ sd_pkt_status_good(struct sd_lun *un, struct buf *bp,
static void
sd_handle_request_sense(struct sd_lun *un, struct buf *sense_bp,
- struct sd_xbuf *sense_xp, struct scsi_pkt *sense_pktp)
+ struct sd_xbuf *sense_xp, struct scsi_pkt *sense_pktp)
{
struct buf *cmd_bp; /* buf for the original command */
struct sd_xbuf *cmd_xp; /* sd_xbuf for the original command */
@@ -17578,7 +17572,7 @@ sd_handle_request_sense(struct sd_lun *un, struct buf *sense_bp,
static void
sd_handle_auto_request_sense(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
struct scsi_arq_status *asp;
size_t actual_len;
@@ -17668,7 +17662,7 @@ sd_handle_auto_request_sense(struct sd_lun *un, struct buf *bp,
static void
sd_print_sense_failed_msg(struct sd_lun *un, struct buf *bp, void *arg,
- int code)
+ int code)
{
char *msgp = arg;
@@ -17697,7 +17691,7 @@ sd_print_sense_failed_msg(struct sd_lun *un, struct buf *bp, void *arg,
static int
sd_validate_sense_data(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
- size_t actual_len)
+ size_t actual_len)
{
struct scsi_extended_sense *esp;
struct scsi_pkt *pktp;
@@ -17866,7 +17860,7 @@ sense_failed:
static void
sd_decode_sense(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
- struct scsi_pkt *pktp)
+ struct scsi_pkt *pktp)
{
uint8_t sense_key;
@@ -18168,8 +18162,8 @@ sd_print_sense_msg(struct sd_lun *un, struct buf *bp, void *arg, int code)
*/
static void
-sd_sense_key_no_sense(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_sense_key_no_sense(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
+ struct scsi_pkt *pktp)
{
struct sd_sense_info si;
@@ -18198,9 +18192,8 @@ sd_sense_key_no_sense(struct sd_lun *un, struct buf *bp,
*/
static void
-sd_sense_key_recoverable_error(struct sd_lun *un,
- uint8_t *sense_datap,
- struct buf *bp, struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_sense_key_recoverable_error(struct sd_lun *un, uint8_t *sense_datap,
+ struct buf *bp, struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
struct sd_sense_info si;
uint8_t asc = scsi_sense_asc(sense_datap);
@@ -18256,9 +18249,8 @@ sd_sense_key_recoverable_error(struct sd_lun *un,
*/
static void
-sd_sense_key_not_ready(struct sd_lun *un,
- uint8_t *sense_datap,
- struct buf *bp, struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_sense_key_not_ready(struct sd_lun *un, uint8_t *sense_datap, struct buf *bp,
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
struct sd_sense_info si;
uint8_t asc = scsi_sense_asc(sense_datap);
@@ -18527,9 +18519,8 @@ fail_command:
*/
static void
-sd_sense_key_medium_or_hardware_error(struct sd_lun *un,
- uint8_t *sense_datap,
- struct buf *bp, struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_sense_key_medium_or_hardware_error(struct sd_lun *un, uint8_t *sense_datap,
+ struct buf *bp, struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
struct sd_sense_info si;
uint8_t sense_key = scsi_sense_key(sense_datap);
@@ -18625,7 +18616,7 @@ sd_sense_key_medium_or_hardware_error(struct sd_lun *un,
static void
sd_sense_key_illegal_request(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
struct sd_sense_info si;
@@ -18657,9 +18648,8 @@ sd_sense_key_illegal_request(struct sd_lun *un, struct buf *bp,
*/
static void
-sd_sense_key_unit_attention(struct sd_lun *un,
- uint8_t *sense_datap,
- struct buf *bp, struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_sense_key_unit_attention(struct sd_lun *un, uint8_t *sense_datap,
+ struct buf *bp, struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
/*
* For UNIT ATTENTION we allow retries for one minute. Devices
@@ -18810,8 +18800,8 @@ do_retry:
*/
static void
-sd_sense_key_fail_command(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_sense_key_fail_command(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
+ struct scsi_pkt *pktp)
{
struct sd_sense_info si;
@@ -18840,8 +18830,8 @@ sd_sense_key_fail_command(struct sd_lun *un, struct buf *bp,
*/
static void
-sd_sense_key_blank_check(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_sense_key_blank_check(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
+ struct scsi_pkt *pktp)
{
struct sd_sense_info si;
@@ -18876,7 +18866,7 @@ sd_sense_key_blank_check(struct sd_lun *un, struct buf *bp,
static void
sd_sense_key_aborted_command(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
struct sd_sense_info si;
@@ -18911,9 +18901,8 @@ sd_sense_key_aborted_command(struct sd_lun *un, struct buf *bp,
*/
static void
-sd_sense_key_default(struct sd_lun *un,
- uint8_t *sense_datap,
- struct buf *bp, struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_sense_key_default(struct sd_lun *un, uint8_t *sense_datap, struct buf *bp,
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
struct sd_sense_info si;
uint8_t sense_key = scsi_sense_key(sense_datap);
@@ -19044,7 +19033,7 @@ update_pkt_reason:
static void
sd_print_cmd_incomplete_msg(struct sd_lun *un, struct buf *bp, void *arg,
- int code)
+ int code)
{
dev_info_t *dip;
@@ -19092,7 +19081,7 @@ sd_print_cmd_incomplete_msg(struct sd_lun *un, struct buf *bp, void *arg,
static void
sd_pkt_reason_cmd_incomplete(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
int flag = SD_RETRIES_STANDARD | SD_RETRIES_ISOLATE;
@@ -19137,7 +19126,7 @@ sd_pkt_reason_cmd_incomplete(struct sd_lun *un, struct buf *bp,
static void
sd_pkt_reason_cmd_tran_err(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -19174,8 +19163,8 @@ sd_pkt_reason_cmd_tran_err(struct sd_lun *un, struct buf *bp,
*/
static void
-sd_pkt_reason_cmd_reset(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_pkt_reason_cmd_reset(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
+ struct scsi_pkt *pktp)
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -19212,8 +19201,8 @@ sd_pkt_reason_cmd_reset(struct sd_lun *un, struct buf *bp,
*/
static void
-sd_pkt_reason_cmd_aborted(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_pkt_reason_cmd_aborted(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
+ struct scsi_pkt *pktp)
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -19249,8 +19238,8 @@ sd_pkt_reason_cmd_aborted(struct sd_lun *un, struct buf *bp,
*/
static void
-sd_pkt_reason_cmd_timeout(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_pkt_reason_cmd_timeout(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
+ struct scsi_pkt *pktp)
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -19286,7 +19275,7 @@ sd_pkt_reason_cmd_timeout(struct sd_lun *un, struct buf *bp,
static void
sd_pkt_reason_cmd_unx_bus_free(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
void (*funcp)(struct sd_lun *un, struct buf *bp, void *arg, int code);
@@ -19317,7 +19306,7 @@ sd_pkt_reason_cmd_unx_bus_free(struct sd_lun *un, struct buf *bp,
static void
sd_pkt_reason_cmd_tag_reject(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -19355,8 +19344,8 @@ sd_pkt_reason_cmd_tag_reject(struct sd_lun *un, struct buf *bp,
*/
static void
-sd_pkt_reason_default(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_pkt_reason_default(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
+ struct scsi_pkt *pktp)
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -19385,7 +19374,7 @@ sd_pkt_reason_default(struct sd_lun *un, struct buf *bp,
static void
sd_pkt_status_check_condition(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -19437,7 +19426,7 @@ sd_pkt_status_check_condition(struct sd_lun *un, struct buf *bp,
static void
sd_pkt_status_busy(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
- struct scsi_pkt *pktp)
+ struct scsi_pkt *pktp)
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -19531,7 +19520,7 @@ sd_pkt_status_busy(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
static void
sd_pkt_status_reservation_conflict(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+ struct sd_xbuf *xp, struct scsi_pkt *pktp)
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -19612,8 +19601,8 @@ sd_pkt_status_reservation_conflict(struct sd_lun *un, struct buf *bp,
*/
static void
-sd_pkt_status_qfull(struct sd_lun *un, struct buf *bp,
- struct sd_xbuf *xp, struct scsi_pkt *pktp)
+sd_pkt_status_qfull(struct sd_lun *un, struct buf *bp, struct sd_xbuf *xp,
+ struct scsi_pkt *pktp)
{
ASSERT(un != NULL);
ASSERT(mutex_owned(SD_MUTEX(un)));
@@ -20131,7 +20120,7 @@ sd_send_scsi_DOORLOCK(sd_ssc_t *ssc, int flag, int path_flag)
static int
sd_send_scsi_READ_CAPACITY(sd_ssc_t *ssc, uint64_t *capp, uint32_t *lbap,
- int path_flag)
+ int path_flag)
{
struct scsi_extended_sense sense_buf;
struct uscsi_cmd ucmd_buf;
@@ -20348,8 +20337,8 @@ rc16_done:
#define SD_CAPACITY_16_SIZE sizeof (struct scsi_capacity_16)
static int
-sd_send_scsi_READ_CAPACITY_16(sd_ssc_t *ssc, uint64_t *capp,
- uint32_t *lbap, uint32_t *psp, int path_flag)
+sd_send_scsi_READ_CAPACITY_16(sd_ssc_t *ssc, uint64_t *capp, uint32_t *lbap,
+ uint32_t *psp, int path_flag)
{
struct scsi_extended_sense sense_buf;
struct uscsi_cmd ucmd_buf;
@@ -20802,7 +20791,7 @@ sd_start_stop_unit_task(void *arg)
static int
sd_send_scsi_INQUIRY(sd_ssc_t *ssc, uchar_t *bufaddr, size_t buflen,
- uchar_t evpd, uchar_t page_code, size_t *residp)
+ uchar_t evpd, uchar_t page_code, size_t *residp)
{
union scsi_cdb cdb;
struct uscsi_cmd ucmd_buf;
@@ -20992,8 +20981,8 @@ sd_send_scsi_TEST_UNIT_READY(sd_ssc_t *ssc, int flag)
*/
static int
-sd_send_scsi_PERSISTENT_RESERVE_IN(sd_ssc_t *ssc, uchar_t usr_cmd,
- uint16_t data_len, uchar_t *data_bufp)
+sd_send_scsi_PERSISTENT_RESERVE_IN(sd_ssc_t *ssc, uchar_t usr_cmd,
+ uint16_t data_len, uchar_t *data_bufp)
{
struct scsi_extended_sense sense_buf;
union scsi_cdb cdb;
@@ -21100,7 +21089,7 @@ sd_send_scsi_PERSISTENT_RESERVE_IN(sd_ssc_t *ssc, uchar_t usr_cmd,
static int
sd_send_scsi_PERSISTENT_RESERVE_OUT(sd_ssc_t *ssc, uchar_t usr_cmd,
- uchar_t *usr_bufp)
+ uchar_t *usr_bufp)
{
struct scsi_extended_sense sense_buf;
union scsi_cdb cdb;
@@ -21519,8 +21508,8 @@ done:
static int
sd_send_scsi_GET_CONFIGURATION(sd_ssc_t *ssc, struct uscsi_cmd *ucmdbuf,
- uchar_t *rqbuf, uint_t rqbuflen, uchar_t *bufaddr, uint_t buflen,
- int path_flag)
+ uchar_t *rqbuf, uint_t rqbuflen, uchar_t *bufaddr, uint_t buflen,
+ int path_flag)
{
char cdb[CDB_GROUP1];
int status;
@@ -21610,9 +21599,9 @@ sd_send_scsi_GET_CONFIGURATION(sd_ssc_t *ssc, struct uscsi_cmd *ucmdbuf,
*
*/
static int
-sd_send_scsi_feature_GET_CONFIGURATION(sd_ssc_t *ssc,
- struct uscsi_cmd *ucmdbuf, uchar_t *rqbuf, uint_t rqbuflen,
- uchar_t *bufaddr, uint_t buflen, char feature, int path_flag)
+sd_send_scsi_feature_GET_CONFIGURATION(sd_ssc_t *ssc, struct uscsi_cmd *ucmdbuf,
+ uchar_t *rqbuf, uint_t rqbuflen, uchar_t *bufaddr, uint_t buflen,
+ char feature, int path_flag)
{
char cdb[CDB_GROUP1];
int status;
@@ -21711,7 +21700,7 @@ sd_send_scsi_feature_GET_CONFIGURATION(sd_ssc_t *ssc,
static int
sd_send_scsi_MODE_SENSE(sd_ssc_t *ssc, int cdbsize, uchar_t *bufaddr,
- size_t buflen, uchar_t page_code, int path_flag)
+ size_t buflen, uchar_t page_code, int path_flag)
{
struct scsi_extended_sense sense_buf;
union scsi_cdb cdb;
@@ -21829,7 +21818,7 @@ sd_send_scsi_MODE_SENSE(sd_ssc_t *ssc, int cdbsize, uchar_t *bufaddr,
static int
sd_send_scsi_MODE_SELECT(sd_ssc_t *ssc, int cdbsize, uchar_t *bufaddr,
- size_t buflen, uchar_t save_page, int path_flag)
+ size_t buflen, uchar_t save_page, int path_flag)
{
struct scsi_extended_sense sense_buf;
union scsi_cdb cdb;
@@ -21936,7 +21925,7 @@ sd_send_scsi_MODE_SELECT(sd_ssc_t *ssc, int cdbsize, uchar_t *bufaddr,
static int
sd_send_scsi_RDWR(sd_ssc_t *ssc, uchar_t cmd, void *bufaddr,
- size_t buflen, daddr_t start_block, int path_flag)
+ size_t buflen, daddr_t start_block, int path_flag)
{
struct scsi_extended_sense sense_buf;
union scsi_cdb cdb;
@@ -22063,9 +22052,7 @@ sd_send_scsi_RDWR(sd_ssc_t *ssc, uchar_t cmd, void *bufaddr,
static int
sd_send_scsi_LOG_SENSE(sd_ssc_t *ssc, uchar_t *bufaddr, uint16_t buflen,
- uchar_t page_code, uchar_t page_control, uint16_t param_ptr,
- int path_flag)
-
+ uchar_t page_code, uchar_t page_control, uint16_t param_ptr, int path_flag)
{
struct scsi_extended_sense sense_buf;
union scsi_cdb cdb;
@@ -22113,7 +22100,7 @@ sd_send_scsi_LOG_SENSE(sd_ssc_t *ssc, uchar_t *bufaddr, uint16_t buflen,
case STATUS_CHECK:
if ((ucmd_buf.uscsi_rqstatus == STATUS_GOOD) &&
(scsi_sense_key((uint8_t *)&sense_buf) ==
- KEY_ILLEGAL_REQUEST) &&
+ KEY_ILLEGAL_REQUEST) &&
(scsi_sense_asc((uint8_t *)&sense_buf) == 0x24)) {
/*
* ASC 0x24: INVALID FIELD IN CDB
@@ -22197,7 +22184,7 @@ sd_send_scsi_LOG_SENSE(sd_ssc_t *ssc, uchar_t *bufaddr, uint16_t buflen,
static int
sd_send_scsi_GET_EVENT_STATUS_NOTIFICATION(sd_ssc_t *ssc, uchar_t *bufaddr,
- size_t buflen, uchar_t class_req)
+ size_t buflen, uchar_t class_req)
{
union scsi_cdb cdb;
struct uscsi_cmd ucmd_buf;
@@ -22533,9 +22520,9 @@ skip_ready_valid:
if ((err == 0) &&
((cmd == DKIOCSETEFI) ||
- (un->un_f_pkstats_enabled) &&
+ ((un->un_f_pkstats_enabled) &&
(cmd == DKIOCSAPART || cmd == DKIOCSVTOC ||
- cmd == DKIOCSEXTVTOC))) {
+ cmd == DKIOCSEXTVTOC)))) {
tmprval = cmlb_validate(un->un_cmlbhandle, CMLB_SILENT,
(void *)SD_PATH_DIRECT);
@@ -23521,7 +23508,7 @@ sd_dkio_ctrl_info(dev_t dev, caddr_t arg, int flag)
*/
static int
sd_get_media_info_com(dev_t dev, uint_t *dki_media_type, uint_t *dki_lbsize,
- diskaddr_t *dki_capacity, uint_t *dki_pbsize)
+ diskaddr_t *dki_capacity, uint_t *dki_pbsize)
{
struct sd_lun *un = NULL;
struct uscsi_cmd com;
@@ -26102,8 +26089,7 @@ sddump(dev_t dev, caddr_t addr, daddr_t blkno, int nblk)
((uint64_t)(blkno * un->un_sys_blocksize)) -
((uint64_t)(tgt_blkno * un->un_tgt_blocksize));
- ASSERT((io_start_offset >= 0) &&
- (io_start_offset < un->un_tgt_blocksize));
+ ASSERT(io_start_offset < un->un_tgt_blocksize);
/*
* Do the modify portion of read modify write.
*/
@@ -26665,10 +26651,10 @@ sd_persistent_reservation_in_read_keys(struct sd_lun *un,
sd_prin_readkeys_t *in;
mhioc_inkeys_t *ptr;
mhioc_key_list_t li;
- uchar_t *data_bufp;
- int data_len;
+ uchar_t *data_bufp = NULL;
+ int data_len = 0;
int rval = 0;
- size_t copysz;
+ size_t copysz = 0;
sd_ssc_t *ssc;
if ((ptr = (mhioc_inkeys_t *)usrp) == NULL) {
@@ -26682,7 +26668,6 @@ sd_persistent_reservation_in_read_keys(struct sd_lun *un,
* Get the listsize from user
*/
#ifdef _MULTI_DATAMODEL
-
switch (ddi_model_convert_from(flag & FMODELS)) {
case DDI_MODEL_ILP32:
copysz = sizeof (struct mhioc_key_list32);
@@ -26832,7 +26817,7 @@ sd_persistent_reservation_in_read_resv(struct sd_lun *un,
int data_len;
int rval = 0;
int i;
- size_t copysz;
+ size_t copysz = 0;
mhioc_resv_desc_t *bufp;
sd_ssc_t *ssc;
@@ -29544,8 +29529,9 @@ sd_range_lock(struct sd_lun *un, daddr_t startb, daddr_t endb, ushort_t typ)
*/
ASSERT(!(sl_wmp->wm_flags & SD_WM_BUSY));
if (sl_wmp->wm_wanted_count == 0) {
- if (wmp != NULL)
+ if (wmp != NULL) {
CHK_N_FREEWMP(un, wmp);
+ }
wmp = sl_wmp;
}
sl_wmp = NULL;
@@ -29751,7 +29737,7 @@ sd_read_modify_write_task(void *arg)
static int
sddump_do_read_of_rmw(struct sd_lun *un, uint64_t blkno, uint64_t nblk,
- struct buf **bpp)
+ struct buf **bpp)
{
int err;
int i;
@@ -30182,8 +30168,8 @@ static uint_t sd_fault_injection_on = 0;
*/
static void
-sd_faultinjection_ioctl(int cmd, intptr_t arg, struct sd_lun *un) {
-
+sd_faultinjection_ioctl(int cmd, intptr_t arg, struct sd_lun *un)
+{
uint_t i = 0;
uint_t rval;
@@ -30450,8 +30436,7 @@ sd_faultinjection_ioctl(int cmd, intptr_t arg, struct sd_lun *un) {
}
mutex_exit(SD_MUTEX(un));
- SD_TRACE(SD_LOG_IOERR, un, "sd_faultinjection_ioctl:"
- " exit\n");
+ SD_TRACE(SD_LOG_IOERR, un, "sd_faultinjection_ioctl: exit\n");
}
diff --git a/usr/src/uts/common/io/scsi/targets/sd_xbuf.c b/usr/src/uts/common/io/scsi/targets/sd_xbuf.c
index 792a5f717c..be464d657c 100644
--- a/usr/src/uts/common/io/scsi/targets/sd_xbuf.c
+++ b/usr/src/uts/common/io/scsi/targets/sd_xbuf.c
@@ -53,7 +53,6 @@
static int xbuf_iostart(ddi_xbuf_attr_t xap);
static void xbuf_dispatch(ddi_xbuf_attr_t xap);
static void xbuf_restart_callback(void *arg);
-static void xbuf_enqueue(struct buf *bp, ddi_xbuf_attr_t xap);
static int xbuf_brk_done(struct buf *bp);
@@ -106,9 +105,9 @@ _NOTE(DATA_READABLE_WITHOUT_LOCK(xbuf_brk::off))
/* ARGSUSED */
DDII ddi_xbuf_attr_t
ddi_xbuf_attr_create(size_t xsize,
- void (*xa_strategy)(struct buf *bp, ddi_xbuf_t xp, void *attr_arg),
- void *attr_arg, uint32_t active_limit, uint32_t reserve_limit,
- major_t major, int flags)
+ void (*xa_strategy)(struct buf *bp, ddi_xbuf_t xp, void *attr_arg),
+ void *attr_arg, uint32_t active_limit, uint32_t reserve_limit,
+ major_t major, int flags)
{
ddi_xbuf_attr_t xap;
diff --git a/usr/src/uts/common/netinet/in.h b/usr/src/uts/common/netinet/in.h
index 7927cf5e24..220537601a 100644
--- a/usr/src/uts/common/netinet/in.h
+++ b/usr/src/uts/common/netinet/in.h
@@ -118,9 +118,11 @@ struct in6_addr {
*/
#ifdef _KERNEL
uint32_t _S6_u32[4]; /* IPv6 address */
+ uint16_t _S6_u16[8]; /* IPv6 address */
uint8_t _S6_u8[16]; /* IPv6 address */
#else
uint8_t _S6_u8[16]; /* IPv6 address */
+ uint16_t _S6_u16[8]; /* IPv6 address */
uint32_t _S6_u32[4]; /* IPv6 address */
#endif
uint32_t __S6_align; /* Align on 32 bit boundary */
@@ -130,6 +132,7 @@ struct in6_addr {
#ifdef _KERNEL
#define s6_addr8 _S6_un._S6_u8
+#define s6_addr16 _S6_un._S6_u16
#define s6_addr32 _S6_un._S6_u32
#endif
diff --git a/usr/src/uts/i86pc/i86hvm/hvm_sd/Makefile b/usr/src/uts/i86pc/i86hvm/hvm_sd/Makefile
index aba7418b0a..f5dc7a922a 100644
--- a/usr/src/uts/i86pc/i86hvm/hvm_sd/Makefile
+++ b/usr/src/uts/i86pc/i86hvm/hvm_sd/Makefile
@@ -70,13 +70,6 @@ LINTTAGS += -erroff=E_STATIC_UNUSED
LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
-CERRWARN += -_gcc=-Wno-unused-function
-CERRWARN += -_gcc=-Wno-unused-label
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-type-limits
-CERRWARN += -_gcc=-Wno-uninitialized
-CERRWARN += -_gcc=-Wno-unused-value
-
#
# Depends on scsi and cmlb
#
diff --git a/usr/src/uts/intel/sd/Makefile b/usr/src/uts/intel/sd/Makefile
index 42af2b7225..90e10840c1 100644
--- a/usr/src/uts/intel/sd/Makefile
+++ b/usr/src/uts/intel/sd/Makefile
@@ -77,13 +77,6 @@ LINTTAGS += -erroff=E_STATIC_UNUSED
LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
-CERRWARN += -_gcc=-Wno-unused-variable
-CERRWARN += -_gcc=-Wno-unused-function
-CERRWARN += -_gcc=-Wno-unused-label
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-type-limits
-CERRWARN += -_gcc=-Wno-uninitialized
-
#
# Depends on scsi and cmlb
#
diff --git a/usr/src/uts/sparc/sd/Makefile b/usr/src/uts/sparc/sd/Makefile
index 08d2efc031..ea74399df4 100644
--- a/usr/src/uts/sparc/sd/Makefile
+++ b/usr/src/uts/sparc/sd/Makefile
@@ -79,13 +79,6 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
LINTTAGS += -erroff=E_STATIC_UNUSED
LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
-CERRWARN += -_gcc=-Wno-unused-variable
-CERRWARN += -_gcc=-Wno-unused-function
-CERRWARN += -_gcc=-Wno-unused-label
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-type-limits
-CERRWARN += -_gcc=-Wno-uninitialized
-
#
# Default build targets.
#