summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2018-05-02 11:45:52 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2018-05-02 11:45:52 +0000
commit21010238a099cd373426f6caba5f6d15a0bc918d (patch)
treef0a8ec42f40d5489185804d3281c76b6633027dd
parent11b4b83b31e63fb27818351677574b3560fb5886 (diff)
parentbb1f424574ac8e08069d0ba993c2a41ffe796794 (diff)
downloadillumos-joyent-21010238a099cd373426f6caba5f6d15a0bc918d.tar.gz
[illumos-gate merge]
commit bb1f424574ac8e08069d0ba993c2a41ffe796794 9443 panic when scrub a v10 pool commit ae5ee1bd5e54409b4589217b160c8cf4b81e2fb8 9237 "zpool add" fails for very large pools commit 20b5dafb425396adaebd0267d29e1026fc4dc413 9421 zdb should detect and print out the number of "leaked" objects 9422 zfs diff and zdb should explicitly mark objects that are on the deleted queue commit 93a1902e519bf492c071b48ffb93e5c1c7b53fb9 9194 mechanism to override ashift at pool creation time commit aa321b3cd36298fca4306c4e06284d250e998cf7 9500 HP scanner needs smaller SMB2 rwsize commit 73769bc1e3c74ccdf2eafae366eacebe85a6f6ff 9508 mandoc(1) should be large file aware 9509 illumos#8424 missed -nostdinc flag commit 2d3f5634d08413d6015ca536f1017b63a8609723 9258 9024 forgot to remove pv_rtls cruft commit 66f654faf94d77a6760e083cb715592f4a408046 9257 hvm drivers don't need to anounce failure to report version
-rw-r--r--usr/src/cmd/zdb/zdb.c15
-rw-r--r--usr/src/lib/libzfs/common/libzfs_diff.c7
-rw-r--r--usr/src/lib/libzfs/common/libzfs_import.c1
-rw-r--r--usr/src/tools/mandoc/Makefile1
-rw-r--r--usr/src/uts/common/fs/smbsrv/smb2_negotiate.c22
-rw-r--r--usr/src/uts/common/fs/zfs/dsl_scan.c5
-rw-r--r--usr/src/uts/common/fs/zfs/vdev.c3
-rw-r--r--usr/src/uts/common/fs/zfs/zfs_znode.c11
-rw-r--r--usr/src/uts/common/xen/io/xdf.c8
-rw-r--r--usr/src/uts/common/xen/io/xnf.c9
-rw-r--r--usr/src/uts/common/xen/io/xpvd.c9
-rw-r--r--usr/src/uts/i86pc/i86hvm/io/xpv/xpv_support.c9
-rw-r--r--usr/src/uts/i86pc/i86hvm/pv_rtls/Makefile90
13 files changed, 68 insertions, 122 deletions
diff --git a/usr/src/cmd/zdb/zdb.c b/usr/src/cmd/zdb/zdb.c
index cb02698ceb..bdf197ae23 100644
--- a/usr/src/cmd/zdb/zdb.c
+++ b/usr/src/cmd/zdb/zdb.c
@@ -108,6 +108,7 @@ uint64_t *zopt_object = NULL;
static unsigned zopt_objects = 0;
libzfs_handle_t *g_zfs;
uint64_t max_inflight = 1000;
+static int leaked_objects = 0;
static void snprintf_blkptr_compact(char *, size_t, const blkptr_t *);
@@ -1965,9 +1966,12 @@ dump_znode(objset_t *os, uint64_t object, void *data, size_t size)
if (dump_opt['d'] > 4) {
error = zfs_obj_to_path(os, object, path, sizeof (path));
- if (error != 0) {
+ if (error == ESTALE) {
+ (void) snprintf(path, sizeof (path), "on delete queue");
+ } else if (error != 0) {
+ leaked_objects++;
(void) snprintf(path, sizeof (path),
- "\?\?\?<object#%llu>", (u_longlong_t)object);
+ "path not found, possibly leaked");
}
(void) printf("\tpath %s\n", path);
}
@@ -2297,6 +2301,11 @@ dump_dir(objset_t *os)
(void) fprintf(stderr, "dmu_object_next() = %d\n", error);
abort();
}
+ if (leaked_objects != 0) {
+ (void) printf("%d potentially leaked objects detected\n",
+ leaked_objects);
+ leaked_objects = 0;
+ }
}
static void
@@ -5367,5 +5376,5 @@ main(int argc, char **argv)
libzfs_fini(g_zfs);
kernel_fini();
- return (0);
+ return (error);
}
diff --git a/usr/src/lib/libzfs/common/libzfs_diff.c b/usr/src/lib/libzfs/common/libzfs_diff.c
index d6cf32714d..b47b669e80 100644
--- a/usr/src/lib/libzfs/common/libzfs_diff.c
+++ b/usr/src/lib/libzfs/common/libzfs_diff.c
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2015, 2017 by Delphix. All rights reserved.
* Copyright 2016 Joyent, Inc.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
*/
@@ -103,7 +103,10 @@ get_stats_for_obj(differ_info_t *di, const char *dsname, uint64_t obj,
return (0);
}
- if (di->zerr == EPERM) {
+ if (di->zerr == ESTALE) {
+ (void) snprintf(pn, maxlen, "(on_delete_queue)");
+ return (0);
+ } else if (di->zerr == EPERM) {
(void) snprintf(di->errbuf, sizeof (di->errbuf),
dgettext(TEXT_DOMAIN,
"The sys_config privilege or diff delegated permission "
diff --git a/usr/src/lib/libzfs/common/libzfs_import.c b/usr/src/lib/libzfs/common/libzfs_import.c
index dbe37944a7..d28e852ef6 100644
--- a/usr/src/lib/libzfs/common/libzfs_import.c
+++ b/usr/src/lib/libzfs/common/libzfs_import.c
@@ -895,6 +895,7 @@ zpool_read_label(int fd, nvlist_t **config)
free(label);
*config = NULL;
+ errno = ENOENT;
return (-1);
}
diff --git a/usr/src/tools/mandoc/Makefile b/usr/src/tools/mandoc/Makefile
index e3b1b39422..f6e39d759d 100644
--- a/usr/src/tools/mandoc/Makefile
+++ b/usr/src/tools/mandoc/Makefile
@@ -28,6 +28,7 @@ OBJS += fts.o \
recallocarray.o \
strtonum.o
+CPPFLAGS += -_gcc=-nostdinc
CPPFLAGS += -I. -include fts.h
CPPFLAGS += -I$(NATIVE_ADJUNCT)/include
LDFLAGS += -L$(NATIVE_ADJUNCT)/lib -R$(NATIVE_ADJUNCT)/lib
diff --git a/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c b/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c
index a0affa8a58..a4f827e756 100644
--- a/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c
+++ b/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c
@@ -50,6 +50,15 @@ uint32_t smb2_max_rwsize = (1<<20); /* 1MB */
uint32_t smb2_max_trans = (1<<16); /* 64KB */
/*
+ * With clients (e.g. HP scanners) that don't advertise SMB2_CAP_LARGE_MTU
+ * (including all clients using dialect < SMB 2.1), use a "conservative" value
+ * for max r/w size because some older clients misbehave with larger values.
+ * 64KB is recommended in the [MS-SMB2] spec. (3.3.5.3.1 SMB 2.1 or SMB 3.x
+ * Support) as the minimum so we'll use that.
+ */
+uint32_t smb2_old_rwsize = (1<<16); /* 64KB */
+
+/*
* List of all SMB2 versions we implement. Note that the
* highest version we support may be limited by the
* _cfg.skc_max_protocol setting.
@@ -249,6 +258,7 @@ smb2_negotiate_common(smb_request_t *sr, uint16_t version)
timestruc_t boot_tv, now_tv;
smb_session_t *s = sr->session;
int rc;
+ uint32_t max_rwsize;
uint16_t secmode;
sr->smb2_status = 0;
@@ -297,6 +307,14 @@ smb2_negotiate_common(smb_request_t *sr, uint16_t version)
return (-1); /* will drop */
}
+ /*
+ * See notes above smb2_max_rwsize, smb2_old_rwsize
+ */
+ if (s->capabilities & SMB2_CAP_LARGE_MTU)
+ max_rwsize = smb2_max_rwsize;
+ else
+ max_rwsize = smb2_old_rwsize;
+
rc = smb_mbc_encodef(
&sr->reply,
"wwww#cllllTTwwl#c",
@@ -308,8 +326,8 @@ smb2_negotiate_common(smb_request_t *sr, uint16_t version)
&s->s_cfg.skc_machine_uuid, /* c */
smb2srv_capabilities, /* l */
smb2_max_trans, /* l */
- smb2_max_rwsize, /* l */
- smb2_max_rwsize, /* l */
+ max_rwsize, /* l */
+ max_rwsize, /* l */
&now_tv, /* T */
&boot_tv, /* T */
128, /* SecBufOff */ /* w */
diff --git a/usr/src/uts/common/fs/zfs/dsl_scan.c b/usr/src/uts/common/fs/zfs/dsl_scan.c
index fbc1c4d08b..cf93849a62 100644
--- a/usr/src/uts/common/fs/zfs/dsl_scan.c
+++ b/usr/src/uts/common/fs/zfs/dsl_scan.c
@@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2018 by Delphix. All rights reserved.
* Copyright 2016 Gary Mills
* Copyright (c) 2011, 2017 by Delphix. All rights reserved.
* Copyright 2017 Joyent, Inc.
@@ -1185,7 +1185,8 @@ dsl_scan_visitds(dsl_scan_t *scn, uint64_t dsobj, dmu_tx_t *tx)
* block-sharing rules don't apply to it.
*/
if (DSL_SCAN_IS_SCRUB_RESILVER(scn) && !dsl_dataset_is_snapshot(ds) &&
- ds->ds_dir != dp->dp_origin_snap->ds_dir) {
+ (dp->dp_origin_snap == NULL ||
+ ds->ds_dir != dp->dp_origin_snap->ds_dir)) {
objset_t *os;
if (dmu_objset_from_ds(ds, &os) != 0) {
goto out;
diff --git a/usr/src/uts/common/fs/zfs/vdev.c b/usr/src/uts/common/fs/zfs/vdev.c
index 0c0057e9b6..6fee8109e0 100644
--- a/usr/src/uts/common/fs/zfs/vdev.c
+++ b/usr/src/uts/common/fs/zfs/vdev.c
@@ -96,6 +96,8 @@ int vdev_dtl_sm_blksz = (1 << 12);
*/
int vdev_standard_sm_blksz = (1 << 17);
+int zfs_ashift_min;
+
/*PRINTFLIKE2*/
void
vdev_dbgmsg(vdev_t *vd, const char *fmt, ...)
@@ -1511,6 +1513,7 @@ vdev_open(vdev_t *vd)
vd->vdev_asize = asize;
vd->vdev_max_asize = max_asize;
vd->vdev_ashift = MAX(ashift, vd->vdev_ashift);
+ vd->vdev_ashift = MAX(zfs_ashift_min, vd->vdev_ashift);
} else {
/*
* Detect if the alignment requirement has increased.
diff --git a/usr/src/uts/common/fs/zfs/zfs_znode.c b/usr/src/uts/common/fs/zfs/zfs_znode.c
index a8ae102f77..73e17a4a3c 100644
--- a/usr/src/uts/common/fs/zfs/zfs_znode.c
+++ b/usr/src/uts/common/fs/zfs/zfs_znode.c
@@ -2036,6 +2036,17 @@ zfs_obj_to_path_impl(objset_t *osp, uint64_t obj, sa_handle_t *hdl,
*path = '\0';
sa_hdl = hdl;
+ uint64_t deleteq_obj;
+ VERIFY0(zap_lookup(osp, MASTER_NODE_OBJ,
+ ZFS_UNLINKED_SET, sizeof (uint64_t), 1, &deleteq_obj));
+ error = zap_lookup_int(osp, deleteq_obj, obj);
+ if (error == 0) {
+ return (ESTALE);
+ } else if (error != ENOENT) {
+ return (error);
+ }
+ error = 0;
+
for (;;) {
uint64_t pobj;
char component[MAXNAMELEN + 2];
diff --git a/usr/src/uts/common/xen/io/xdf.c b/usr/src/uts/common/xen/io/xdf.c
index 71e9a17ae7..7a945b8cf1 100644
--- a/usr/src/uts/common/xen/io/xdf.c
+++ b/usr/src/uts/common/xen/io/xdf.c
@@ -3598,11 +3598,9 @@ done:
#ifdef XPV_HVM_DRIVER
xdf_hvm_add(dip);
- /* Report our version to dom0. */
- if (xenbus_printf(XBT_NULL, "guest/xdf", "version", "%d",
- HVMPV_XDF_VERS))
- cmn_err(CE_WARN, "xdf: couldn't write version\n");
-
+ /* Report our version to dom0 */
+ (void) xenbus_printf(XBT_NULL, "guest/xdf", "version", "%d",
+ HVMPV_XDF_VERS);
#endif /* XPV_HVM_DRIVER */
/* Create kstat for iostat(1M) */
diff --git a/usr/src/uts/common/xen/io/xnf.c b/usr/src/uts/common/xen/io/xnf.c
index e2475b5942..ebed9c5f7e 100644
--- a/usr/src/uts/common/xen/io/xnf.c
+++ b/usr/src/uts/common/xen/io/xnf.c
@@ -1057,12 +1057,9 @@ xnf_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)
xnfp->xnf_rx_new_buffers_posted = B_FALSE;
#ifdef XPV_HVM_DRIVER
- /*
- * Report our version to dom0.
- */
- if (xenbus_printf(XBT_NULL, "guest/xnf", "version", "%d",
- HVMPV_XNF_VERS))
- cmn_err(CE_WARN, "xnf: couldn't write version\n");
+ /* Report our version to dom0 */
+ (void) xenbus_printf(XBT_NULL, "guest/xnf", "version", "%d",
+ HVMPV_XNF_VERS);
#endif
/*
diff --git a/usr/src/uts/common/xen/io/xpvd.c b/usr/src/uts/common/xen/io/xpvd.c
index 343f8254ba..5f8966fce7 100644
--- a/usr/src/uts/common/xen/io/xpvd.c
+++ b/usr/src/uts/common/xen/io/xpvd.c
@@ -287,12 +287,9 @@ xpvd_attach(dev_info_t *devi, ddi_attach_cmd_t cmd)
#ifdef XPV_HVM_DRIVER
(void) ddi_prop_update_int(DDI_DEV_T_NONE, devi, DDI_NO_AUTODETACH, 1);
- /*
- * Report our version to dom0.
- */
- if (xenbus_printf(XBT_NULL, "guest/xpvd", "version", "%d",
- HVMPV_XPVD_VERS))
- cmn_err(CE_WARN, "xpvd: couldn't write version\n");
+ /* Report our version to dom0 */
+ (void) xenbus_printf(XBT_NULL, "guest/xpvd", "version", "%d",
+ HVMPV_XPVD_VERS);
#endif /* XPV_HVM_DRIVER */
/* watch both frontend and backend for new devices */
diff --git a/usr/src/uts/i86pc/i86hvm/io/xpv/xpv_support.c b/usr/src/uts/i86pc/i86hvm/io/xpv/xpv_support.c
index e6c1b6f6a8..4cd568737b 100644
--- a/usr/src/uts/i86pc/i86hvm/io/xpv/xpv_support.c
+++ b/usr/src/uts/i86pc/i86hvm/io/xpv/xpv_support.c
@@ -739,12 +739,9 @@ xpv_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
*/
memscrub_disable();
- /*
- * Report our version to dom0.
- */
- if (xenbus_printf(XBT_NULL, "guest/xpv", "version", "%d",
- HVMPV_XPV_VERS))
- cmn_err(CE_WARN, "xpv: couldn't write version\n");
+ /* Report our version to dom0 */
+ (void) xenbus_printf(XBT_NULL, "guest/xpv", "version", "%d",
+ HVMPV_XPV_VERS);
return (DDI_SUCCESS);
}
diff --git a/usr/src/uts/i86pc/i86hvm/pv_rtls/Makefile b/usr/src/uts/i86pc/i86hvm/pv_rtls/Makefile
deleted file mode 100644
index a2cabdef52..0000000000
--- a/usr/src/uts/i86pc/i86hvm/pv_rtls/Makefile
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# uts/i86pc/pv_rtls/Makefile
-#
-# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-#ident "%Z%%M% %I% %E% SMI"
-#
-# This makefile drives the production of the null rtls module for xvm.
-#
-# i86pc implementation architecture dependent
-#
-# Path to the base of the uts directory tree (usually /usr/src/uts).
-#
-UTSBASE = ../../..
-
-#
-# Define the module and object file sets.
-#
-MODULE = rtls
-OBJECTS = $(PV_RTLS_OBJS:%=$(OBJS_DIR)/%)
-LINTS = $(PV_RTLS_OBJS:%.o=$(LINTS_DIR)/%.ln)
-ROOTMODULE = $(ROOT_HVM_DRV_DIR)/$(MODULE)
-
-#
-# Include common rules.
-#
-include $(UTSBASE)/i86pc/i86hvm/Makefile.i86hvm
-
-#
-# When generating lint libraries, we want the name of the lint module
-# that will be generated to be pv_rtls and not rtls, so override the
-# default lint module name here.
-#
-LINT_MODULE = pv_rtls
-
-#
-# Define targets
-#
-ALL_TARGET = $(BINARY)
-LINT_TARGET = $(LINT_MODULE).lint
-INSTALL_TARGET = $(BINARY) $(ROOTMODULE)
-
-LDFLAGS += -dy
-
-#
-# Default build targets.
-#
-.KEEP_STATE:
-
-def: $(DEF_DEPS)
-
-all: $(ALL_DEPS)
-
-clean: $(CLEAN_DEPS)
-
-clobber: $(CLOBBER_DEPS)
-
-lint: $(LINT_DEPS)
-
-modlintlib: $(MODLINTLIB_DEPS)
-
-clean.lint: $(CLEAN_LINT_DEPS)
-
-install: $(INSTALL_DEPS)
-
-#
-# Include common targets.
-#
-include $(UTSBASE)/i86pc/i86hvm/Makefile.targ