From 66f654faf94d77a6760e083cb715592f4a408046 Mon Sep 17 00:00:00 2001 From: Yuri Pankov Date: Sat, 10 Mar 2018 05:49:11 +0300 Subject: 9257 hvm drivers don't need to anounce failure to report version Reviewed by: Toomas Soome Reviewed by: Robert Mustacchi Approved by: Dan McDonald --- usr/src/uts/common/xen/io/xdf.c | 8 +++----- usr/src/uts/common/xen/io/xnf.c | 9 +++------ usr/src/uts/common/xen/io/xpvd.c | 9 +++------ usr/src/uts/i86pc/i86hvm/io/xpv/xpv_support.c | 9 +++------ 4 files changed, 12 insertions(+), 23 deletions(-) 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); } -- cgit v1.2.3 From 2d3f5634d08413d6015ca536f1017b63a8609723 Mon Sep 17 00:00:00 2001 From: Yuri Pankov Date: Sat, 10 Mar 2018 05:50:04 +0300 Subject: 9258 9024 forgot to remove pv_rtls cruft Reviewed by: Toomas Soome Reviewed by: Robert Mustacchi Approved by: Dan McDonald --- usr/src/uts/i86pc/i86hvm/pv_rtls/Makefile | 90 ------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 usr/src/uts/i86pc/i86hvm/pv_rtls/Makefile 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 -- cgit v1.2.3 From 73769bc1e3c74ccdf2eafae366eacebe85a6f6ff Mon Sep 17 00:00:00 2001 From: Jason King Date: Wed, 25 Apr 2018 15:51:01 -0500 Subject: 9508 mandoc(1) should be large file aware 9509 illumos#8424 missed -nostdinc flag Reviewed by: Yuri Pankov Reviewed by: Andy Fiddaman Approved by: Dan McDonald --- usr/src/cmd/mandoc/Makefile.common | 3 ++- usr/src/tools/mandoc/Makefile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/src/cmd/mandoc/Makefile.common b/usr/src/cmd/mandoc/Makefile.common index ac5b6fe2ac..e47ef79569 100644 --- a/usr/src/cmd/mandoc/Makefile.common +++ b/usr/src/cmd/mandoc/Makefile.common @@ -12,6 +12,7 @@ # # Copyright 2014 Garrett D'Amore # Copyright 2017 Nexenta Systems, Inc. +# Copyright 2018, Joyent, Inc. # PROG= mandoc @@ -78,6 +79,6 @@ OBJS += compat_ohash.o CFLAGS += $(CC_VERBOSE) CSTD = $(CSTD_GNU99) -CPPFLAGS += -DOSNAME="\"illumos\"" +CPPFLAGS += -DOSNAME="\"illumos\"" -D_FILE_OFFSET_BITS=64 LDLIBS += -lz diff --git a/usr/src/tools/mandoc/Makefile b/usr/src/tools/mandoc/Makefile index c63e900c75..c60f0893ed 100644 --- a/usr/src/tools/mandoc/Makefile +++ b/usr/src/tools/mandoc/Makefile @@ -11,7 +11,7 @@ # # Copyright 2017 Nexenta Systems, Inc. -# Copyright 2017 Joyent, Inc. +# Copyright 2018 Joyent, Inc. # CMDDIR= $(SRC)/cmd/mandoc @@ -25,6 +25,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 -- cgit v1.2.3 From aa321b3cd36298fca4306c4e06284d250e998cf7 Mon Sep 17 00:00:00 2001 From: Dan McDonald Date: Mon, 30 Apr 2018 11:30:28 -0400 Subject: 9500 HP scanner needs smaller SMB2 rwsize Reviewed by: Yuri Pankov Reviewed by: Andy Fiddaman Reviewed by: Bill Sommerfeld Reviewed by: Toomas Soome Approved by: Gordon Ross --- usr/src/uts/common/fs/smbsrv/smb2_negotiate.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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 @@ -49,6 +49,15 @@ uint32_t smb2_tcp_bufsize = (1<<22); /* 4MB */ 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 @@ -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 */ -- cgit v1.2.3 From 93a1902e519bf492c071b48ffb93e5c1c7b53fb9 Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Thu, 13 Apr 2017 11:56:16 -0700 Subject: 9194 mechanism to override ashift at pool creation time Reviewed by: Serapheim Dimitropoulos Reviewed by: Prakash Surya Reviewed by: Allan Jude Reviewed by: Igor Kozhukhov Reviewed by: Richard Elling Approved by: Dan McDonald --- usr/src/uts/common/fs/zfs/vdev.c | 3 +++ 1 file changed, 3 insertions(+) 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. -- cgit v1.2.3 From 20b5dafb425396adaebd0267d29e1026fc4dc413 Mon Sep 17 00:00:00 2001 From: Paul Dagnelie Date: Thu, 6 Jul 2017 10:35:20 -0700 Subject: 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 Reviewed by: Matt Ahrens Reviewed by: Pavel Zakharov Approved by: Matt Ahrens --- usr/src/cmd/zdb/zdb.c | 15 ++++++++++++--- usr/src/lib/libzfs/common/libzfs_diff.c | 7 +++++-- usr/src/uts/common/fs/zfs/zfs_znode.c | 11 +++++++++++ 3 files changed, 28 insertions(+), 5 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), - "\?\?\?", (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 */ @@ -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/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]; -- cgit v1.2.3 From ae5ee1bd5e54409b4589217b160c8cf4b81e2fb8 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Mon, 5 Mar 2018 11:31:44 -0700 Subject: 9237 "zpool add" fails for very large pools Reviewed by: Matthew Ahrens Reviewed by: Andriy Gapon Approved by: Matt Ahrens --- usr/src/lib/libzfs/common/libzfs_import.c | 1 + 1 file changed, 1 insertion(+) 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); } -- cgit v1.2.3 From bb1f424574ac8e08069d0ba993c2a41ffe796794 Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Mon, 5 Feb 2018 10:06:18 -0800 Subject: 9443 panic when scrub a v10 pool Reviewed by: Serapheim Dimitropoulos Reviewed by: George Wilson Reviewed by: Andriy Gapon Reviewed by: Igor Kozhukhov Approved by: Dan McDonald --- usr/src/uts/common/fs/zfs/dsl_scan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- cgit v1.2.3