summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2018-09-19 12:30:47 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2018-09-19 12:30:47 +0000
commita149c206ad4a0b0845b293a58accc36cc411052f (patch)
treef1f17f60cfa30707da246d14f0ee4ae38c578187
parent08ed30b08319fab99ae1fcd27f76a5fb17250478 (diff)
parent7928f4baf4ab3230557eb6289be68aa7a3003f38 (diff)
downloadillumos-joyent-a149c206ad4a0b0845b293a58accc36cc411052f.tar.gz
[illumos-gate merge]
commit 7928f4baf4ab3230557eb6289be68aa7a3003f38 9617 too-frequent TXG sync causes excessive write inflation commit e19b450bec203d8be04447ea476d7a86b36d63a1 8601 memory leak in get_special_prop() commit 1946268f4b5e55d1de5a354a87463d24be6991ca 9680 dsl_dataset_hold_obj can leak bookmarks commit 7341a7de4f0489193e0cfe11049a7bcf1596a4db 9677 panic from zio_write_gang_block() when creating dump device on fragmented rpool commit f62db44dbcda5dd786bb821f1e6fd3ca2e6d4391 9616 Bogus error when attempting to set property on read-only pool commit 837327673cfef3fa0e815ea9377af002d7b1e01b 9839 unix: add translation for netboot properties commit cbb9248e66a77c6382c6f48aebae5fd0ee60fa69 9835 ses topo module should use topo_mod_clean_str() commit 00d7a6fb939233ed021b823016c33fcae1dac964 9455 Expose drive speed and temperature on disk topo node commit c952f9c1bd80512c5c1db6f7c8c4b49d40154098 9844 libi386: Fix typo in pxe.h commit 4837313c99a7d59b1241728101760485b74f8d2b 9837 nfs_dlinet: allow nfs:// urls Conflicts: usr/src/lib/fm/topo/modules/common/disk/disk_common.c
-rw-r--r--usr/src/boot/sys/boot/i386/libi386/pxe.h2
-rw-r--r--usr/src/lib/fm/topo/modules/common/disk/disk_common.c3
-rw-r--r--usr/src/lib/fm/topo/modules/common/ses/ses.c12
-rw-r--r--usr/src/lib/fm/topo/modules/common/ses/ses_facility.c48
-rw-r--r--usr/src/lib/libzfs/common/libzfs_dataset.c11
-rw-r--r--usr/src/uts/common/fs/nfs/nfs_dlinet.c39
-rw-r--r--usr/src/uts/common/fs/zfs/dsl_dataset.c1
-rw-r--r--usr/src/uts/common/fs/zfs/dsl_pool.c10
-rw-r--r--usr/src/uts/common/fs/zfs/sys/dsl_pool.h2
-rw-r--r--usr/src/uts/common/fs/zfs/txg.c4
-rw-r--r--usr/src/uts/common/fs/zfs/zcp_get.c17
-rw-r--r--usr/src/uts/common/fs/zfs/zio.c20
-rw-r--r--usr/src/uts/i86pc/os/fakebop.c36
13 files changed, 147 insertions, 58 deletions
diff --git a/usr/src/boot/sys/boot/i386/libi386/pxe.h b/usr/src/boot/sys/boot/i386/libi386/pxe.h
index 1afc23bf4b..67e2c643d8 100644
--- a/usr/src/boot/sys/boot/i386/libi386/pxe.h
+++ b/usr/src/boot/sys/boot/i386/libi386/pxe.h
@@ -145,7 +145,7 @@ typedef struct {
PXENV_STATUS_t Status;
ADDR32_t ProtocolIni; /* Phys addr of a copy of the driver module */
uint8_t reserved[8];
-} PACKED t_PXENV_UNDI_INITALIZE;
+} PACKED t_PXENV_UNDI_INITIALIZE;
#define MAXNUM_MCADDR 8
diff --git a/usr/src/lib/fm/topo/modules/common/disk/disk_common.c b/usr/src/lib/fm/topo/modules/common/disk/disk_common.c
index 9110e3bc62..340275d63f 100644
--- a/usr/src/lib/fm/topo/modules/common/disk/disk_common.c
+++ b/usr/src/lib/fm/topo/modules/common/disk/disk_common.c
@@ -551,6 +551,7 @@ disk_tnode_create(topo_mod_t *mod, tnode_t *parent,
}
if (dnode != NULL && dnode->ddn_devid != NULL &&
+ if (dnode->ddn_devid != NULL &&
disk_add_temp_sensor(mod, dtn, dnode->ddn_devid) != 0) {
topo_mod_dprintf(mod, "disk_tnode_create: failed to create "
"temperature sensor node on bay=%d/disk=0",
@@ -776,7 +777,7 @@ dev_di_node_add(di_node_t node, char *devid, disk_cbdata_t *cbp)
char lentry[MAXPATHLEN];
int pathcount;
int *inq_dtype, itype;
- int i;
+ int i;
if (devid) {
/*
diff --git a/usr/src/lib/fm/topo/modules/common/ses/ses.c b/usr/src/lib/fm/topo/modules/common/ses/ses.c
index 647d5975a6..cbfd2da1c2 100644
--- a/usr/src/lib/fm/topo/modules/common/ses/ses.c
+++ b/usr/src/lib/fm/topo/modules/common/ses/ses.c
@@ -1454,9 +1454,9 @@ ses_create_generic(ses_enum_data_t *sdp, ses_enum_node_t *snp, tnode_t *pnode,
/*
* For the node label, we look for the following in order:
*
- * <ses-description>
- * <ses-class-description> <instance>
- * <default-type-label> <instance>
+ * <ses-description>
+ * <ses-class-description> <instance>
+ * <default-type-label> <instance>
*/
if (nvlist_lookup_string(props, SES_PROP_DESCRIPTION, &desc) != 0 ||
desc[0] == '\0') {
@@ -2850,9 +2850,9 @@ ses_create_chassis(ses_enum_data_t *sdp, tnode_t *pnode, ses_enum_chassis_t *cp)
/*
* We use the following property mappings:
*
- * manufacturer vendor-id
- * model product-id
- * serial-number libses-chassis-serial
+ * manufacturer vendor-id
+ * model product-id
+ * serial-number libses-chassis-serial
*/
verify(nvlist_lookup_string(props, SES_EN_PROP_VID,
&raw_manufacturer) == 0);
diff --git a/usr/src/lib/fm/topo/modules/common/ses/ses_facility.c b/usr/src/lib/fm/topo/modules/common/ses/ses_facility.c
index 125c41a83f..2c4a1314e3 100644
--- a/usr/src/lib/fm/topo/modules/common/ses/ses_facility.c
+++ b/usr/src/lib/fm/topo/modules/common/ses/ses_facility.c
@@ -36,34 +36,34 @@
* Facility node support for SES enclosures. We support the following facility
* nodes, based on the node type:
*
- * bay
- * indicator=ident
- * indicator=fail
- * indicator=ok2rm
- * sensor=fault
+ * bay
+ * indicator=ident
+ * indicator=fail
+ * indicator=ok2rm
+ * sensor=fault
*
- * controller
- * indicator=ident
- * indicator=fail
+ * controller
+ * indicator=ident
+ * indicator=fail
*
- * fan
- * indicator=ident
- * indicator=fail
- * sensor=speed
- * sensor=fault
+ * fan
+ * indicator=ident
+ * indicator=fail
+ * sensor=speed
+ * sensor=fault
*
- * psu
- * indicator=ident
- * indicator=fail
- * sensor=status
+ * psu
+ * indicator=ident
+ * indicator=fail
+ * sensor=status
*
- * ses-enclosure
- * indicator=ident
- * indicator=fail
- * sensor=fault
- * sensor=<name> (temperature)
- * sensor=<name> (voltage)
- * sensor=<name> (current)
+ * ses-enclosure
+ * indicator=ident
+ * indicator=fail
+ * sensor=fault
+ * sensor=<name> (temperature)
+ * sensor=<name> (voltage)
+ * sensor=<name> (current)
*
* Most of these are handled by a single method that supports getting and
* setting boolean properties on the node. The fan speed sensor requires a
diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c
index 9eeaa6a528..124c8519ec 100644
--- a/usr/src/lib/libzfs/common/libzfs_dataset.c
+++ b/usr/src/lib/libzfs/common/libzfs_dataset.c
@@ -30,7 +30,7 @@
* Copyright (c) 2014 Integros [integros.com]
* Copyright 2017 Nexenta Systems, Inc.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
- * Copyright 2017 RackTop Systems.
+ * Copyright 2017-2018 RackTop Systems.
*/
#include <ctype.h>
@@ -1812,13 +1812,18 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvlist_t *props)
ret = zfs_ioctl(hdl, ZFS_IOC_SET_PROP, &zc);
if (ret != 0) {
+ if (zc.zc_nvlist_dst_filled == B_FALSE) {
+ (void) zfs_standard_error(hdl, errno, errbuf);
+ goto error;
+ }
+
/* Get the list of unset properties back and report them. */
nvlist_t *errorprops = NULL;
if (zcmd_read_dst_nvlist(hdl, &zc, &errorprops) != 0)
goto error;
- for (nvpair_t *elem = nvlist_next_nvpair(nvl, NULL);
+ for (nvpair_t *elem = nvlist_next_nvpair(errorprops, NULL);
elem != NULL;
- elem = nvlist_next_nvpair(nvl, elem)) {
+ elem = nvlist_next_nvpair(errorprops, elem)) {
zfs_prop_t prop = zfs_name_to_prop(nvpair_name(elem));
zfs_setprop_error(hdl, prop, errno, errbuf);
}
diff --git a/usr/src/uts/common/fs/nfs/nfs_dlinet.c b/usr/src/uts/common/fs/nfs/nfs_dlinet.c
index 8ac4c84d17..34658b161f 100644
--- a/usr/src/uts/common/fs/nfs/nfs_dlinet.c
+++ b/usr/src/uts/common/fs/nfs/nfs_dlinet.c
@@ -1201,11 +1201,38 @@ cacheinit(void)
if (doptp == NULL)
doptp = pl->opts[CD_ROOT_PATH];
if (doptp != NULL) {
- int len;
+ int len, size;
+ uint8_t c, *source;
+
str = NULL;
- for (len = 0; len < doptp->len; len++) {
- if (doptp->value[len] == ':') {
- str = (char *)(&doptp->value[++len]);
+ source = doptp->value;
+ size = doptp->len;
+ c = ':';
+
+ /*
+ * We have to consider three cases for root path:
+ * "nfs://server_ip/path"
+ * "server_ip:/path"
+ * "/path"
+ */
+ if (bcmp(source, "nfs://", 6) == 0) {
+ source += 6;
+ size -= 6;
+ c = '/';
+ }
+ /*
+ * Search for next char after ':' or first '/'.
+ * Note, the '/' is part of the path, but we do
+ * not need to preserve the ':'.
+ */
+ for (len = 0; len < size; len++) {
+ if (source[len] == c) {
+ if (c == ':') {
+ str = (char *)(&source[++len]);
+ } else {
+ str = (char *)(&source[len++]);
+ size++;
+ }
break;
}
}
@@ -1213,7 +1240,7 @@ cacheinit(void)
/* Do not override server_ip from property. */
if ((*(uint_t *)server_ip) == 0) {
char *ip = kmem_alloc(len, KM_SLEEP);
- bcopy(doptp->value, ip, len);
+ bcopy(source, ip, len);
ip[len - 1] = '\0';
if (inet_aton((ip), server_ip) != 0) {
cmn_err(CE_NOTE,
@@ -1228,7 +1255,7 @@ cacheinit(void)
server_ip));
}
}
- len = doptp->len - len;
+ len = size - len;
} else {
str = (char *)doptp->value;
len = doptp->len;
diff --git a/usr/src/uts/common/fs/zfs/dsl_dataset.c b/usr/src/uts/common/fs/zfs/dsl_dataset.c
index a08477e29d..fd51f851c4 100644
--- a/usr/src/uts/common/fs/zfs/dsl_dataset.c
+++ b/usr/src/uts/common/fs/zfs/dsl_dataset.c
@@ -559,6 +559,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uint64_t dsobj, void *tag,
dsl_deadlist_close(&ds->ds_deadlist);
if (dsl_deadlist_is_open(&ds->ds_remap_deadlist))
dsl_deadlist_close(&ds->ds_remap_deadlist);
+ dsl_bookmark_fini_ds(ds);
if (ds->ds_prev)
dsl_dataset_rele(ds->ds_prev, ds);
dsl_dir_rele(ds->ds_dir, ds);
diff --git a/usr/src/uts/common/fs/zfs/dsl_pool.c b/usr/src/uts/common/fs/zfs/dsl_pool.c
index 854be91503..6bb34fd7af 100644
--- a/usr/src/uts/common/fs/zfs/dsl_pool.c
+++ b/usr/src/uts/common/fs/zfs/dsl_pool.c
@@ -104,9 +104,11 @@ uint64_t zfs_dirty_data_max_max = 4ULL * 1024 * 1024 * 1024;
int zfs_dirty_data_max_percent = 10;
/*
- * If there is at least this much dirty data, push out a txg.
+ * If there's at least this much dirty data (as a percentage of
+ * zfs_dirty_data_max), push out a txg. This should be less than
+ * zfs_vdev_async_write_active_min_dirty_percent.
*/
-uint64_t zfs_dirty_data_sync = 64 * 1024 * 1024;
+uint64_t zfs_dirty_data_sync_pct = 20;
/*
* Once there is this amount of dirty data, the dmu_tx_delay() will kick in
@@ -825,10 +827,12 @@ dsl_pool_need_dirty_delay(dsl_pool_t *dp)
{
uint64_t delay_min_bytes =
zfs_dirty_data_max * zfs_delay_min_dirty_percent / 100;
+ uint64_t dirty_min_bytes =
+ zfs_dirty_data_max * zfs_dirty_data_sync_pct / 100;
boolean_t rv;
mutex_enter(&dp->dp_lock);
- if (dp->dp_dirty_total > zfs_dirty_data_sync)
+ if (dp->dp_dirty_total > dirty_min_bytes)
txg_kick(dp);
rv = (dp->dp_dirty_total > delay_min_bytes);
mutex_exit(&dp->dp_lock);
diff --git a/usr/src/uts/common/fs/zfs/sys/dsl_pool.h b/usr/src/uts/common/fs/zfs/sys/dsl_pool.h
index 2df0f21f98..c79c5bf735 100644
--- a/usr/src/uts/common/fs/zfs/sys/dsl_pool.h
+++ b/usr/src/uts/common/fs/zfs/sys/dsl_pool.h
@@ -53,7 +53,7 @@ struct dsl_scan;
extern uint64_t zfs_dirty_data_max;
extern uint64_t zfs_dirty_data_max_max;
-extern uint64_t zfs_dirty_data_sync;
+extern uint64_t zfs_dirty_data_sync_pct;
extern int zfs_dirty_data_max_percent;
extern int zfs_delay_min_dirty_percent;
extern uint64_t zfs_delay_scale;
diff --git a/usr/src/uts/common/fs/zfs/txg.c b/usr/src/uts/common/fs/zfs/txg.c
index 6d2ffe9921..a9a44a6286 100644
--- a/usr/src/uts/common/fs/zfs/txg.c
+++ b/usr/src/uts/common/fs/zfs/txg.c
@@ -485,6 +485,8 @@ txg_sync_thread(void *arg)
uint64_t timeout = zfs_txg_timeout * hz;
uint64_t timer;
uint64_t txg;
+ uint64_t dirty_min_bytes =
+ zfs_dirty_data_max * zfs_dirty_data_sync_pct / 100;
/*
* We sync when we're scanning, there's someone waiting
@@ -496,7 +498,7 @@ txg_sync_thread(void *arg)
!tx->tx_exiting && timer > 0 &&
tx->tx_synced_txg >= tx->tx_sync_txg_waiting &&
!txg_has_quiesced_to_sync(dp) &&
- dp->dp_dirty_total < zfs_dirty_data_sync) {
+ dp->dp_dirty_total < dirty_min_bytes) {
dprintf("waiting; tx_synced=%llu waiting=%llu dp=%p\n",
tx->tx_synced_txg, tx->tx_sync_txg_waiting, dp);
txg_thread_wait(tx, &cpr, &tx->tx_sync_more_cv, timer);
diff --git a/usr/src/uts/common/fs/zfs/zcp_get.c b/usr/src/uts/common/fs/zfs/zcp_get.c
index 54e141d967..85e00a0f93 100644
--- a/usr/src/uts/common/fs/zfs/zcp_get.c
+++ b/usr/src/uts/common/fs/zfs/zcp_get.c
@@ -14,7 +14,7 @@
*/
/*
- * Copyright (c) 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2016, 2017 by Delphix. All rights reserved.
*/
#include "lua.h"
@@ -422,16 +422,21 @@ get_special_prop(lua_State *state, dsl_dataset_t *ds, const char *dsname,
case ZFS_PROP_INCONSISTENT:
numval = dsl_get_inconsistent(ds);
break;
- case ZFS_PROP_RECEIVE_RESUME_TOKEN:
- VERIFY3U(strlcpy(strval, get_receive_resume_stats_impl(ds),
- ZAP_MAXVALUELEN), <, ZAP_MAXVALUELEN);
+ case ZFS_PROP_RECEIVE_RESUME_TOKEN: {
+ char *token = get_receive_resume_stats_impl(ds);
+ VERIFY3U(strlcpy(strval, token, ZAP_MAXVALUELEN), <,
+ ZAP_MAXVALUELEN);
+ strfree(token);
if (strcmp(strval, "") == 0) {
- VERIFY3U(strlcpy(strval, get_child_receive_stats(ds),
- ZAP_MAXVALUELEN), <, ZAP_MAXVALUELEN);
+ token = get_child_receive_stats(ds);
+ VERIFY3U(strlcpy(strval, token, ZAP_MAXVALUELEN), <,
+ ZAP_MAXVALUELEN);
+ strfree(token);
if (strcmp(strval, "") == 0)
error = ENOENT;
}
break;
+ }
case ZFS_PROP_VOLSIZE:
ASSERT(ds_type == ZFS_TYPE_VOLUME);
error = dmu_objset_from_ds(ds, &os);
diff --git a/usr/src/uts/common/fs/zfs/zio.c b/usr/src/uts/common/fs/zfs/zio.c
index a7ef33d799..42888830a1 100644
--- a/usr/src/uts/common/fs/zfs/zio.c
+++ b/usr/src/uts/common/fs/zfs/zio.c
@@ -2197,7 +2197,13 @@ zio_write_gang_member_ready(zio_t *zio)
static void
zio_write_gang_done(zio_t *zio)
{
- abd_put(zio->io_abd);
+ /*
+ * The io_abd field will be NULL for a zio with no data. The io_flags
+ * will initially have the ZIO_FLAG_NODATA bit flag set, but we can't
+ * check for it here as it is cleared in zio_ready.
+ */
+ if (zio->io_abd != NULL)
+ abd_put(zio->io_abd);
}
static int
@@ -2218,11 +2224,12 @@ zio_write_gang_block(zio_t *pio)
int gbh_copies = MIN(copies + 1, spa_max_replication(spa));
zio_prop_t zp;
int error;
+ boolean_t has_data = !(pio->io_flags & ZIO_FLAG_NODATA);
int flags = METASLAB_HINTBP_FAVOR | METASLAB_GANG_HEADER;
if (pio->io_flags & ZIO_FLAG_IO_ALLOCATING) {
ASSERT(pio->io_priority == ZIO_PRIORITY_ASYNC_WRITE);
- ASSERT(!(pio->io_flags & ZIO_FLAG_NODATA));
+ ASSERT(has_data);
flags |= METASLAB_ASYNC_ALLOC;
VERIFY(refcount_held(&mc->mc_alloc_slots[pio->io_allocator],
@@ -2246,7 +2253,7 @@ zio_write_gang_block(zio_t *pio)
if (error) {
if (pio->io_flags & ZIO_FLAG_IO_ALLOCATING) {
ASSERT(pio->io_priority == ZIO_PRIORITY_ASYNC_WRITE);
- ASSERT(!(pio->io_flags & ZIO_FLAG_NODATA));
+ ASSERT(has_data);
/*
* If we failed to allocate the gang block header then
@@ -2299,14 +2306,15 @@ zio_write_gang_block(zio_t *pio)
zp.zp_nopwrite = B_FALSE;
zio_t *cio = zio_write(zio, spa, txg, &gbh->zg_blkptr[g],
- abd_get_offset(pio->io_abd, pio->io_size - resid), lsize,
- lsize, &zp, zio_write_gang_member_ready, NULL, NULL,
+ has_data ? abd_get_offset(pio->io_abd, pio->io_size -
+ resid) : NULL, lsize, lsize, &zp,
+ zio_write_gang_member_ready, NULL, NULL,
zio_write_gang_done, &gn->gn_child[g], pio->io_priority,
ZIO_GANG_CHILD_FLAGS(pio), &pio->io_bookmark);
if (pio->io_flags & ZIO_FLAG_IO_ALLOCATING) {
ASSERT(pio->io_priority == ZIO_PRIORITY_ASYNC_WRITE);
- ASSERT(!(pio->io_flags & ZIO_FLAG_NODATA));
+ ASSERT(has_data);
/*
* Gang children won't throttle but we should
diff --git a/usr/src/uts/i86pc/os/fakebop.c b/usr/src/uts/i86pc/os/fakebop.c
index ff5e4ea7a4..f381504e39 100644
--- a/usr/src/uts/i86pc/os/fakebop.c
+++ b/usr/src/uts/i86pc/os/fakebop.c
@@ -1314,6 +1314,42 @@ process_boot_environment(struct boot_modules *benv)
if (do_bsys_getproplen(NULL, name) >= 0)
continue;
+ /* Translate netboot variables */
+ if (strcmp(name, "boot.netif.gateway") == 0) {
+ bsetprops(BP_ROUTER_IP, value);
+ continue;
+ }
+ if (strcmp(name, "boot.netif.hwaddr") == 0) {
+ bsetprops(BP_BOOT_MAC, value);
+ continue;
+ }
+ if (strcmp(name, "boot.netif.ip") == 0) {
+ bsetprops(BP_HOST_IP, value);
+ continue;
+ }
+ if (strcmp(name, "boot.netif.netmask") == 0) {
+ bsetprops(BP_SUBNET_MASK, value);
+ continue;
+ }
+ if (strcmp(name, "boot.netif.server") == 0) {
+ bsetprops(BP_SERVER_IP, value);
+ continue;
+ }
+ if (strcmp(name, "boot.netif.server") == 0) {
+ if (do_bsys_getproplen(NULL, BP_SERVER_IP) < 0)
+ bsetprops(BP_SERVER_IP, value);
+ continue;
+ }
+ if (strcmp(name, "boot.nfsroot.server") == 0) {
+ if (do_bsys_getproplen(NULL, BP_SERVER_IP) < 0)
+ bsetprops(BP_SERVER_IP, value);
+ continue;
+ }
+ if (strcmp(name, "boot.nfsroot.path") == 0) {
+ bsetprops(BP_SERVER_PATH, value);
+ continue;
+ }
+
if (name_is_blacklisted(name) == B_TRUE)
continue;