summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2016-11-21 12:34:54 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2016-11-21 12:34:54 +0000
commitde53b36c571e97a4fbff4241211ffe91ace1c684 (patch)
treecf75c45fb3638a334ab2e33dea465db72bcc507a
parentb6ebeeac71aba19031ac94ed8f38ac1f180f5170 (diff)
parent6c6016e36550d1281cc80b26506a45d0d9bdb903 (diff)
downloadillumos-joyent-de53b36c571e97a4fbff4241211ffe91ace1c684.tar.gz
[illumos-gate merge]
commit 6c6016e36550d1281cc80b26506a45d0d9bdb903 7547 rmalloc(9f) should mention rmallocmap_wait(9f) commit 52892d1d2b839551e473726ed56248a5b5649dc3 7585 Clarify mac private properties must be strings commit d174594cd572c5bbd8ecd98580222fb60508bade 7592 acpi commands link against host libc commit fab9be40d6bb364713294f6f6c925ccc58bacb24 7594 ld -zaslr should accept Solaris-compatible values commit 1c9272b861cd640a8342f4407da026ed98615517 7570 tunable to allow zvol SCSI unmap to return on commit of txn to ZIL commit b001165b0c3b957ada8be2307cb7337d3ae15871 7544 power(9E) should refer to dev_ops(9S), not cb_ops(9S) commit 386be055703d6da0a32d56189e59e87f1608c761 7589 nfs(4): delegation should be changed to server_delegation commit 9c02c7edf62c061c8b4d3134fb190ea51af6f69f 7565 loader: report sector size and number of sectors in lsdev output for bios disks commit 2c601221f598e1c7737ee1128853af2a7be2acb2 7591 New "zloop" command for running ztest indefinitely commit ad2760acbd9c3b479bf632f05c6f03d89830799d 7571 non-present readonly numeric ZFS props do not have default value commit 4dd77f9e38ef05b39db128ff7608d926fd3218c6 7545 zdb should disable reference tracking commit 91e2a09f39b7b47ff919323f4118fab26e6641d8 7543 ::spa -h should show free space histogram for whole pool commit 09c9e6dc9b69d10b771bb87e01040ec320a0bfd3 7542 zfs_unmount failed with EZFS_UNSHARENFSFAILED commit 5e629e018f19831ddde0164b9e2714a09fc1f1eb 7546 usb_get_max_pkts_per_isoc_request(9F) thinks it is a different function
-rw-r--r--usr/src/boot/sys/boot/i386/libi386/biosdisk.c7
-rw-r--r--usr/src/cmd/Makefile.targ7
-rw-r--r--usr/src/cmd/acpi/acpidump/Makefile3
-rw-r--r--usr/src/cmd/acpi/acpixtract/Makefile3
-rw-r--r--usr/src/cmd/mdb/common/modules/zfs/zfs.c100
-rw-r--r--usr/src/cmd/sgs/libld/common/args.c12
-rw-r--r--usr/src/cmd/sgs/libld/common/libld.msg2
-rw-r--r--usr/src/cmd/sgs/packages/common/SUNWonld-README1
-rw-r--r--usr/src/cmd/zdb/zdb.c7
-rw-r--r--usr/src/cmd/ztest/Makefile10
-rwxr-xr-xusr/src/cmd/ztest/zloop.bash204
-rw-r--r--usr/src/lib/libshare/common/libsharecore.c3
-rw-r--r--usr/src/lib/libzfs/common/libzfs_dataset.c3
-rw-r--r--usr/src/lib/libzfs/common/libzfs_impl.h5
-rw-r--r--usr/src/lib/libzfs/common/libzfs_mount.c42
-rw-r--r--usr/src/man/man4/nfs.46
-rw-r--r--usr/src/man/man9e/mc_getprop.9e7
-rw-r--r--usr/src/man/man9e/power.9e13
-rw-r--r--usr/src/man/man9f/rmalloc.9f163
-rw-r--r--usr/src/man/man9f/usb_get_max_pkts_per_isoc_request.9f12
-rw-r--r--usr/src/pkg/manifests/system-file-system-zfs-tests.mf3
-rw-r--r--usr/src/uts/common/fs/zfs/zvol.c41
22 files changed, 474 insertions, 180 deletions
diff --git a/usr/src/boot/sys/boot/i386/libi386/biosdisk.c b/usr/src/boot/sys/boot/i386/libi386/biosdisk.c
index faa03309a8..bf11f27e0c 100644
--- a/usr/src/boot/sys/boot/i386/libi386/biosdisk.c
+++ b/usr/src/boot/sys/boot/i386/libi386/biosdisk.c
@@ -288,9 +288,12 @@ bd_print(int verbose)
int i, ret = 0;
for (i = 0; i < nbdinfo; i++) {
- sprintf(line, " disk%d: BIOS drive %c:\n", i,
+ snprintf(line, sizeof (line),
+ " disk%d: BIOS drive %c (%ju X %u):\n", i,
(bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit):
- ('C' + bdinfo[i].bd_unit - 0x80));
+ ('C' + bdinfo[i].bd_unit - 0x80),
+ (uintmax_t)bdinfo[i].bd_sectors,
+ bdinfo[i].bd_sectorsize);
ret = pager_output(line);
if (ret != 0)
return (ret);
diff --git a/usr/src/cmd/Makefile.targ b/usr/src/cmd/Makefile.targ
index 0dcc692c78..4b3e5b3181 100644
--- a/usr/src/cmd/Makefile.targ
+++ b/usr/src/cmd/Makefile.targ
@@ -22,6 +22,8 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright (c) 2015 by Delphix. All rights reserved.
+#
# cmd/Makefile.targ
# common target definitions for command builds
#
@@ -64,6 +66,11 @@ $(KSHPROG): $(KSHPROG).ksh
sed -e "s/TEXT_DOMAIN/${TEXT_DOMAIN}/g" $(KSHPROG).ksh > $@
$(CHMOD) +x $@
+$(BASHPROG): $(BASHPROG).bash
+ $(RM) $@
+ sed -e "s/TEXT_DOMAIN/${TEXT_DOMAIN}/g" $(BASHPROG).bash > $@
+ $(CHMOD) +x $@
+
#
# For message catalogue files
#
diff --git a/usr/src/cmd/acpi/acpidump/Makefile b/usr/src/cmd/acpi/acpidump/Makefile
index f5bdff70c2..35a352d851 100644
--- a/usr/src/cmd/acpi/acpidump/Makefile
+++ b/usr/src/cmd/acpi/acpidump/Makefile
@@ -9,6 +9,7 @@
# http://www.illumos.org/license/CDDL.
#
# Copyright 2016 Joyent, Inc.
+# Copyright 2016 RackTop Systems.
#
PROG= acpidump
@@ -29,7 +30,7 @@ CPPFLAGS += -I$(SRC)/uts/intel/sys/acpi -DACPI_DUMP_APP
all: $(PROG)
$(PROG): $(OBJS)
- $(LINK.c) -o $@ $(OBJS) ../common/acpi.a
+ $(LINK.c) -o $@ $(OBJS) ../common/acpi.a $(LDLIBS)
$(POST_PROCESS)
install: all $(ROOTUSRSBINPROG)
diff --git a/usr/src/cmd/acpi/acpixtract/Makefile b/usr/src/cmd/acpi/acpixtract/Makefile
index 7ec08f9ab5..deba09c0cc 100644
--- a/usr/src/cmd/acpi/acpixtract/Makefile
+++ b/usr/src/cmd/acpi/acpixtract/Makefile
@@ -9,6 +9,7 @@
# http://www.illumos.org/license/CDDL.
#
# Copyright 2016 Joyent, Inc.
+# Copyright 2016 RackTop Systems.
#
PROG= acpixtract
@@ -28,7 +29,7 @@ CPPFLAGS += -I$(SRC)/uts/intel/sys/acpi -DACPI_XTRACT_APP
all: $(PROG)
$(PROG): $(OBJS)
- $(LINK.c) -o $@ $(OBJS) ../common/acpi.a
+ $(LINK.c) -o $@ $(OBJS) ../common/acpi.a $(LDLIBS)
$(POST_PROCESS)
install: all $(ROOTUSRSBINPROG)
diff --git a/usr/src/cmd/mdb/common/modules/zfs/zfs.c b/usr/src/cmd/mdb/common/modules/zfs/zfs.c
index 12f26d382c..fd419f6ea2 100644
--- a/usr/src/cmd/mdb/common/modules/zfs/zfs.c
+++ b/usr/src/cmd/mdb/common/modules/zfs/zfs.c
@@ -21,7 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
*/
/* Portions Copyright 2010 Robert Milkowski */
@@ -66,9 +66,12 @@ enum spa_flags {
SPA_FLAG_HISTOGRAMS = 1 << 5
};
+/*
+ * If any of these flags are set, call spa_vdevs in spa_print
+ */
#define SPA_FLAG_ALL_VDEV \
(SPA_FLAG_VDEVS | SPA_FLAG_ERRORS | SPA_FLAG_METASLAB_GROUPS | \
- SPA_FLAG_METASLABS | SPA_FLAG_HISTOGRAMS)
+ SPA_FLAG_METASLABS)
static int
getmember(uintptr_t addr, const char *type, mdb_ctf_id_t *idp,
@@ -1082,8 +1085,65 @@ arc_print(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
typedef struct mdb_spa_print {
pool_state_t spa_state;
char spa_name[ZFS_MAX_DATASET_NAME_LEN];
+ uintptr_t spa_normal_class;
} mdb_spa_print_t;
+
+const char histo_stars[] = "****************************************";
+const int histo_width = sizeof (histo_stars) - 1;
+
+static void
+dump_histogram(const uint64_t *histo, int size, int offset)
+{
+ int i;
+ int minidx = size - 1;
+ int maxidx = 0;
+ uint64_t max = 0;
+
+ for (i = 0; i < size; i++) {
+ if (histo[i] > max)
+ max = histo[i];
+ if (histo[i] > 0 && i > maxidx)
+ maxidx = i;
+ if (histo[i] > 0 && i < minidx)
+ minidx = i;
+ }
+
+ if (max < histo_width)
+ max = histo_width;
+
+ for (i = minidx; i <= maxidx; i++) {
+ mdb_printf("%3u: %6llu %s\n",
+ i + offset, (u_longlong_t)histo[i],
+ &histo_stars[(max - histo[i]) * histo_width / max]);
+ }
+}
+
+typedef struct mdb_metaslab_class {
+ uint64_t mc_histogram[RANGE_TREE_HISTOGRAM_SIZE];
+} mdb_metaslab_class_t;
+
+/*
+ * spa_class_histogram(uintptr_t class_addr)
+ *
+ * Prints free space histogram for a device class
+ *
+ * Returns DCMD_OK, or DCMD_ERR.
+ */
+static int
+spa_class_histogram(uintptr_t class_addr)
+{
+ mdb_metaslab_class_t mc;
+ if (mdb_ctf_vread(&mc, "metaslab_class_t",
+ "mdb_metaslab_class_t", class_addr, 0) == -1)
+ return (DCMD_ERR);
+
+ mdb_inc_indent(4);
+ dump_histogram(mc.mc_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0);
+ mdb_dec_indent(4);
+ return (DCMD_OK);
+}
+
/*
* ::spa
*
@@ -1144,6 +1204,8 @@ spa_print(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
state = statetab[spa.spa_state];
mdb_printf("%0?p %9s %s\n", addr, state, spa.spa_name);
+ if (spa_flags & SPA_FLAG_HISTOGRAMS)
+ spa_class_histogram(spa.spa_normal_class);
if (spa_flags & SPA_FLAG_CONFIG) {
mdb_printf("\n");
@@ -1216,35 +1278,7 @@ spa_print_config(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
0, NULL));
}
-const char histo_stars[] = "****************************************";
-const int histo_width = sizeof (histo_stars) - 1;
-static void
-dump_histogram(const uint64_t *histo, int size, int offset)
-{
- int i;
- int minidx = size - 1;
- int maxidx = 0;
- uint64_t max = 0;
-
- for (i = 0; i < size; i++) {
- if (histo[i] > max)
- max = histo[i];
- if (histo[i] > 0 && i > maxidx)
- maxidx = i;
- if (histo[i] > 0 && i < minidx)
- minidx = i;
- }
-
- if (max < histo_width)
- max = histo_width;
-
- for (i = minidx; i <= maxidx; i++) {
- mdb_printf("%3u: %6llu %s\n",
- i + offset, (u_longlong_t)histo[i],
- &histo_stars[(max - histo[i]) * histo_width / max]);
- }
-}
typedef struct mdb_range_tree {
uint64_t rt_space;
@@ -3722,11 +3756,11 @@ static const mdb_dcmd_t dcmds[] = {
"\t-M display metaslab group statistic\n"
"\t-h display histogram (requires -m or -M)\n",
"given a spa_t, print vdev summary", spa_vdevs },
- { "vdev", ":[-re]\n"
+ { "vdev", ":[-remMh]\n"
"\t-r display recursively\n"
"\t-e display statistics\n"
- "\t-m display metaslab statistics\n"
- "\t-M display metaslab group statistics\n"
+ "\t-m display metaslab statistics (top level vdev only)\n"
+ "\t-M display metaslab group statistics (top level vdev only)\n"
"\t-h display histogram (requires -m or -M)\n",
"vdev_t summary", vdev_print },
{ "zio", ":[-cpr]\n"
diff --git a/usr/src/cmd/sgs/libld/common/args.c b/usr/src/cmd/sgs/libld/common/args.c
index 495fed322c..d130f4ecf3 100644
--- a/usr/src/cmd/sgs/libld/common/args.c
+++ b/usr/src/cmd/sgs/libld/common/args.c
@@ -1444,11 +1444,15 @@ parseopt_pass1(Ofl_desc *ofl, int argc, char **argv, int *usage)
} else if (*p == '=') {
p++;
- if (strcmp(p,
- MSG_ORIG(MSG_ARG_ENABLED)) == 0) {
+ if ((strcmp(p,
+ MSG_ORIG(MSG_ARG_ENABLED)) == 0) ||
+ (strcmp(p,
+ MSG_ORIG(MSG_ARG_ENABLE)) == 0)) {
ofl->ofl_aslr = 1;
- } else if (strcmp(p,
- MSG_ORIG(MSG_ARG_DISABLED)) == 0) {
+ } else if ((strcmp(p,
+ MSG_ORIG(MSG_ARG_DISABLED)) == 0) ||
+ (strcmp(p,
+ MSG_ORIG(MSG_ARG_DISABLE)) == 0)) {
ofl->ofl_aslr = -1;
} else {
ld_eprintf(ofl, ERR_FATAL,
diff --git a/usr/src/cmd/sgs/libld/common/libld.msg b/usr/src/cmd/sgs/libld/common/libld.msg
index dd77130b40..26c0e33054 100644
--- a/usr/src/cmd/sgs/libld/common/libld.msg
+++ b/usr/src/cmd/sgs/libld/common/libld.msg
@@ -1477,6 +1477,8 @@
@ MSG_ARG_ENABLED "enabled"
@ MSG_ARG_DISABLED "disabled"
+@ MSG_ARG_ENABLE "enable"
+@ MSG_ARG_DISABLE "disable"
# -z guidance=item strings
@ MSG_ARG_GUIDE_DELIM ",: \t"
diff --git a/usr/src/cmd/sgs/packages/common/SUNWonld-README b/usr/src/cmd/sgs/packages/common/SUNWonld-README
index bc757a0aa4..0f3d5f67bd 100644
--- a/usr/src/cmd/sgs/packages/common/SUNWonld-README
+++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README
@@ -1659,3 +1659,4 @@ Bugid Risk Synopsis
6098 ld(1) should not require symbols which identify group sections be global
6252 ld should merge function/data-sections in the same manner as GNU ld
7323 ld(1) -zignore can erroneously discard init and fini arrays as unreferenced
+7594 ld -zaslr should accept Solaris-compatible values
diff --git a/usr/src/cmd/zdb/zdb.c b/usr/src/cmd/zdb/zdb.c
index 1357cf9707..95985a6c48 100644
--- a/usr/src/cmd/zdb/zdb.c
+++ b/usr/src/cmd/zdb/zdb.c
@@ -75,10 +75,12 @@
DMU_OT_ZAP_OTHER : DMU_OT_NUMTYPES))
#ifndef lint
+extern int reference_tracking_enable;
extern boolean_t zfs_recover;
extern uint64_t zfs_arc_max, zfs_arc_meta_limit;
extern int zfs_vdev_async_read_max_active;
#else
+int reference_tracking_enable;
boolean_t zfs_recover;
uint64_t zfs_arc_max, zfs_arc_meta_limit;
int zfs_vdev_async_read_max_active;
@@ -3666,6 +3668,11 @@ main(int argc, char **argv)
*/
zfs_vdev_async_read_max_active = 10;
+ /*
+ * Disable reference tracking for better performance.
+ */
+ reference_tracking_enable = B_FALSE;
+
kernel_init(FREAD);
g_zfs = libzfs_init();
ASSERT(g_zfs != NULL);
diff --git a/usr/src/cmd/ztest/Makefile b/usr/src/cmd/ztest/Makefile
index 1a34525b2d..5c9bfd4ee8 100644
--- a/usr/src/cmd/ztest/Makefile
+++ b/usr/src/cmd/ztest/Makefile
@@ -22,10 +22,12 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
+# Copyright (c) 2015 by Delphix. All rights reserved.
#
PROG:sh= basename `pwd`
+BASHPROG= zloop
+ROOTBASHPROG= $(ROOTBIN)/$(BASHPROG)
include ../Makefile.cmd
@@ -40,9 +42,11 @@ lint := TARGET = lint
.KEEP_STATE:
-all clean clobber lint: $(SUBDIRS)
+all lint: $(SUBDIRS) $(BASHPROG)
-install: $(SUBDIRS)
+clean clobber: $(SUBDIRS)
+
+install: $(SUBDIRS) $(ROOTBASHPROG)
-$(RM) $(ROOTPROG)
-$(LN) $(ISAEXEC) $(ROOTPROG)
diff --git a/usr/src/cmd/ztest/zloop.bash b/usr/src/cmd/ztest/zloop.bash
new file mode 100755
index 0000000000..7203356d3d
--- /dev/null
+++ b/usr/src/cmd/ztest/zloop.bash
@@ -0,0 +1,204 @@
+#!/bin/bash
+
+#
+# CDDL HEADER START
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2015, 2016 by Delphix. All rights reserved.
+#
+
+set -x
+export BITS=64
+export UMEM_DEBUG=default,verbose
+export UMEM_LOGGING=transaction,contents
+set +x
+
+sparc_32=sparc
+sparc_64=sparcv9
+i386_32=i86
+i386_64=amd64
+ARCH=`uname -p`
+eval 'ARCHBITS=${'"${ARCH}_${BITS}"'}'
+BIN=$ROOT/usr/bin/${ARCHBITS}
+SBIN=$ROOT/usr/sbin/${ARCHBITS}
+DEFAULTWORKDIR=/var/tmp
+DEFAULTCOREDIR=/var/tmp/zloop
+
+function usage
+{
+ echo -e "\n$0 [-t <timeout>] [-c <dump directory>]" \
+ "[ -- [extra ztest parameters]]\n" \
+ "\n" \
+ " This script runs ztest repeatedly with randomized arguments.\n" \
+ " If a crash is encountered, the ztest logs, any associated\n" \
+ " vdev files, and core file (if one exists) are moved to the\n" \
+ " output directory ($DEFAULTCOREDIR by default). Any options\n" \
+ " after the -- end-of-options marker will be passed to ztest.\n" \
+ "\n" \
+ " Options:\n" \
+ " -t Total time to loop for, in seconds. If not provided,\n" \
+ " zloop runs forever.\n" \
+ " -f Specify working directory for ztest vdev files.\n" \
+ " -c Specify a core dump directory to use.\n" \
+ " -h Print this help message.\n" \
+ "" >&2
+}
+
+function or_die
+{
+ $@
+ if [[ $? -ne 0 ]]; then
+ echo "Command failed: $@"
+ exit 1
+ fi
+}
+
+function store_core
+{
+ if [[ $ztrc -ne 0 ]] || [[ -f core ]]; then
+ coreid=$(/bin/date "+zloop-%y%m%d-%H%M%S")
+ foundcrashes=$(($foundcrashes + 1))
+
+ dest=$coredir/$coreid
+ or_die /bin/mkdir $dest
+ or_die /bin/mkdir $dest/vdev
+
+ echo "*** ztest crash found - moving logs to $coredir/$coreid"
+
+ or_die /bin/mv ztest.history $dest/
+ or_die /bin/mv ztest.out $dest/
+ or_die /bin/mv $workdir/ztest* $dest/vdev/
+ or_die /bin/mv $workdir/zpool.cache $dest/vdev/
+
+ # check for core
+ if [[ -f core ]]; then
+ corestatus=$(mdb -e "::status" core)
+ corestack=$(mdb -e "::stack" core)
+
+ # Dump core + logs to stored directory
+ echo "$corestatus" >>$dest/status
+ echo "$corestack" >>$dest/status
+ or_die /bin/mv core $dest/
+
+ # Record info in cores logfile
+ echo "*** core @ $coredir/$coreid/core:" | /bin/tee -a ztest.cores
+ echo "$corestatus" | /bin/tee -a ztest.cores
+ echo "$corestack" | /bin/tee -a ztest.cores
+ echo "" | /bin/tee -a ztest.cores
+ fi
+ echo "continuing..."
+ fi
+}
+
+set -x
+export PATH=${BIN}:${SBIN}
+export LD_LIBRARY_PATH=$ROOT/lib/$BITS:$ROOT/usr/lib/$BITS
+set +x
+
+# parse arguments
+# expected format: zloop [-t timeout] [-c coredir] [-- extra ztest args]
+coredir=$DEFAULTCOREDIR
+workdir=$DEFAULTWORKDIR
+timeout=0
+while getopts ":ht:c:f:" opt; do
+ case $opt in
+ t ) [[ $OPTARG -gt 0 ]] && timeout=$OPTARG ;;
+ c ) [[ $OPTARG ]] && coredir=$OPTARG ;;
+ f ) [[ $OPTARG ]] && workdir=$(/usr/bin/readlink -f $OPTARG) ;;
+ h ) usage
+ exit 2
+ ;;
+ * ) echo "Invalid argument: -$OPTARG";
+ usage
+ exit 1
+ esac
+done
+# pass remaining arguments on to ztest
+shift $((OPTIND - 1))
+
+if [[ -f core ]]; then
+ echo "There's a core dump here you might want to look at first."
+ exit 1
+fi
+
+if [[ ! -d $coredir ]]; then
+ echo "core dump directory ($coredir) does not exist, creating it."
+ or_die /bin/mkdir -p $coredir
+fi
+
+if [[ ! -w $coredir ]]; then
+ echo "core dump directory ($coredir) is not writable."
+ exit 1
+fi
+
+or_die /bin/rm -f ztest.history
+or_die /bin/rm -f ztest.cores
+
+ztrc=0 # ztest return value
+foundcrashes=0 # number of crashes found so far
+starttime=$(/bin/date +%s)
+curtime=$starttime
+
+# if no timeout was specified, loop forever.
+while [[ $timeout -eq 0 ]] || [[ $curtime -le $(($starttime + $timeout)) ]]; do
+ zopt="-VVVVV"
+
+ # switch between common arrangements & fully randomized
+ if [[ $((RANDOM % 2)) -eq 0 ]]; then
+ mirrors=2
+ raidz=0
+ parity=1
+ vdevs=2
+ else
+ mirrors=$(((RANDOM % 3) * 1))
+ parity=$(((RANDOM % 3) + 1))
+ raidz=$((((RANDOM % 9) + parity + 1) * (RANDOM % 2)))
+ vdevs=$(((RANDOM % 3) + 3))
+ fi
+ align=$(((RANDOM % 2) * 3 + 9))
+ runtime=$((RANDOM % 100))
+ passtime=$((RANDOM % (runtime / 3 + 1) + 10))
+ size=128m
+
+ zopt="$zopt -m $mirrors"
+ zopt="$zopt -r $raidz"
+ zopt="$zopt -R $parity"
+ zopt="$zopt -v $vdevs"
+ zopt="$zopt -a $align"
+ zopt="$zopt -T $runtime"
+ zopt="$zopt -P $passtime"
+ zopt="$zopt -s $size"
+ zopt="$zopt -f $workdir"
+
+ cmd="ztest $zopt $@"
+ desc="$(/bin/date '+%m/%d %T') $cmd"
+ echo "$desc" | /bin/tee -a ztest.history
+ echo "$desc" >>ztest.out
+ $BIN/$cmd >>ztest.out 2>&1
+ ztrc=$?
+ /bin/egrep '===|WARNING' ztest.out >>ztest.history
+
+ store_core
+
+ curtime=$(/bin/date +%s)
+done
+
+echo "zloop finished, $foundcrashes crashes found"
+
+/bin/uptime >>ztest.out
+
+if [[ $foundcrashes -gt 0 ]]; then
+ exit 1
+fi
diff --git a/usr/src/lib/libshare/common/libsharecore.c b/usr/src/lib/libshare/common/libsharecore.c
index ba2aa89fb6..87657a13bf 100644
--- a/usr/src/lib/libshare/common/libsharecore.c
+++ b/usr/src/lib/libshare/common/libsharecore.c
@@ -22,6 +22,7 @@
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2016 by Delphix. All rights reserved.
*/
/*
@@ -2170,7 +2171,7 @@ sa_delete_sharetab(sa_handle_t handle, char *path, char *proto)
/*
* sa_needs_refresh(handle)
*
- * Returns B_TRUE if the internal cache needs to be refreshed do to a
+ * Returns B_TRUE if the internal cache needs to be refreshed due to a
* change by another process. B_FALSE returned otherwise.
*/
boolean_t
diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c
index f4b26d4c8d..da80c41623 100644
--- a/usr/src/lib/libzfs/common/libzfs_dataset.c
+++ b/usr/src/lib/libzfs/common/libzfs_dataset.c
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, Joyent, Inc. All rights reserved.
- * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
* Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved.
* Copyright (c) 2011-2012 Pawel Jakub Dawidek. All rights reserved.
* Copyright (c) 2013 Martin Matuska. All rights reserved.
@@ -2046,6 +2046,7 @@ get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src,
if (zfs_prop_readonly(prop) &&
*source != NULL && (*source)[0] == '\0') {
*source = NULL;
+ return (-1);
}
break;
diff --git a/usr/src/lib/libzfs/common/libzfs_impl.h b/usr/src/lib/libzfs/common/libzfs_impl.h
index 043d8c4832..c99a8324df 100644
--- a/usr/src/lib/libzfs/common/libzfs_impl.h
+++ b/usr/src/lib/libzfs/common/libzfs_impl.h
@@ -23,7 +23,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011 Pawel Jakub Dawidek. All rights reserved.
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
- * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
*/
#ifndef _LIBZFS_IMPL_H
@@ -73,7 +73,6 @@ struct libzfs_handle {
int libzfs_printerr;
int libzfs_storeerr; /* stuff error messages into buffer */
void *libzfs_sharehdl; /* libshare handle */
- uint_t libzfs_shareflags;
boolean_t libzfs_mnttab_enable;
avl_tree_t libzfs_mnttab_cache;
int libzfs_pool_iter;
@@ -84,8 +83,6 @@ struct libzfs_handle {
boolean_t libzfs_cachedprops;
};
-#define ZFSSHARE_MISS 0x01 /* Didn't find entry in cache */
-
struct zfs_handle {
libzfs_handle_t *zfs_hdl;
zpool_handle_t *zpool_hdl;
diff --git a/usr/src/lib/libzfs/common/libzfs_mount.c b/usr/src/lib/libzfs/common/libzfs_mount.c
index 7828e28f03..d1419fb3a8 100644
--- a/usr/src/lib/libzfs/common/libzfs_mount.c
+++ b/usr/src/lib/libzfs/common/libzfs_mount.c
@@ -22,7 +22,7 @@
/*
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2014, 2015 by Delphix. All rights reserved.
+ * Copyright (c) 2014, 2016 by Delphix. All rights reserved.
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
*/
@@ -658,35 +658,30 @@ _zfs_init_libshare(void)
int
zfs_init_libshare(libzfs_handle_t *zhandle, int service)
{
- int ret = SA_OK;
-
if (_sa_init == NULL)
- ret = SA_CONFIG_ERR;
+ return (SA_CONFIG_ERR);
- if (ret == SA_OK && zhandle->libzfs_shareflags & ZFSSHARE_MISS) {
- /*
- * We had a cache miss. Most likely it is a new ZFS
- * dataset that was just created. We want to make sure
- * so check timestamps to see if a different process
- * has updated any of the configuration. If there was
- * some non-ZFS change, we need to re-initialize the
- * internal cache.
- */
- zhandle->libzfs_shareflags &= ~ZFSSHARE_MISS;
- if (_sa_needs_refresh != NULL &&
- _sa_needs_refresh(zhandle->libzfs_sharehdl)) {
- zfs_uninit_libshare(zhandle);
- zhandle->libzfs_sharehdl = _sa_init(service);
- }
+ /*
+ * Attempt to refresh libshare. This is necessary if there was a cache
+ * miss for a new ZFS dataset that was just created, or if state of the
+ * sharetab file has changed since libshare was last initialized. We
+ * want to make sure so check timestamps to see if a different process
+ * has updated any of the configuration. If there was some non-ZFS
+ * change, we need to re-initialize the internal cache.
+ */
+ if (_sa_needs_refresh != NULL &&
+ _sa_needs_refresh(zhandle->libzfs_sharehdl)) {
+ zfs_uninit_libshare(zhandle);
+ zhandle->libzfs_sharehdl = _sa_init(service);
}
- if (ret == SA_OK && zhandle && zhandle->libzfs_sharehdl == NULL)
+ if (zhandle && zhandle->libzfs_sharehdl == NULL)
zhandle->libzfs_sharehdl = _sa_init(service);
- if (ret == SA_OK && zhandle->libzfs_sharehdl == NULL)
- ret = SA_NO_MEMORY;
+ if (zhandle->libzfs_sharehdl == NULL)
+ return (SA_NO_MEMORY);
- return (ret);
+ return (SA_OK);
}
/*
@@ -832,7 +827,6 @@ zfs_share_proto(zfs_handle_t *zhp, zfs_share_proto_t *proto)
zfs_get_name(zhp));
return (-1);
}
- hdl->libzfs_shareflags |= ZFSSHARE_MISS;
share = zfs_sa_find_share(hdl->libzfs_sharehdl,
mountpoint);
}
diff --git a/usr/src/man/man4/nfs.4 b/usr/src/man/man4/nfs.4
index 683feab5df..fa124022d5 100644
--- a/usr/src/man/man4/nfs.4
+++ b/usr/src/man/man4/nfs.4
@@ -19,7 +19,7 @@
.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 2016 Nexenta Systems, Inc.
.\"
-.Dd March 12, 2016
+.Dd November 16, 2016
.Dt NFS 4
.Os
.Sh NAME
@@ -79,8 +79,8 @@ is
.Li 2 ,
while the default maximum version is
.Li 4 .
-.It Sy delegation Ns = Ns Sy on Ns | Ns Sy off
-By default, this variable is commented out and the NFS server provides
+.It Sy server_delegation Ns = Ns Sy on Ns | Ns Sy off
+By default the NFS server provides
delegations to clients. The user can turn off delegations for all exported
filesystems by setting this variable to
.Li off .
diff --git a/usr/src/man/man9e/mc_getprop.9e b/usr/src/man/man9e/mc_getprop.9e
index c9a9f1786f..7f8912711e 100644
--- a/usr/src/man/man9e/mc_getprop.9e
+++ b/usr/src/man/man9e/mc_getprop.9e
@@ -11,7 +11,7 @@
.\"
.\" Copyright 2016 Joyent, Inc.
.\"
-.Dd June 02, 2016
+.Dd November 15, 2016
.Dt MC_GETPROP 9E
.Os
.Sh NAME
@@ -93,6 +93,11 @@ argument and use
on it, comparing it to each of its private (bounded-size) properties to
identify which one it is.
.Pp
+At this time, private properties are limited to being string based
+properties. If other types of property values are used, they will not be
+rendered correctly by
+.Xr dladm 1M .
+.Pp
The device
driver can access its device soft state by casting the
.Fa device
diff --git a/usr/src/man/man9e/power.9e b/usr/src/man/man9e/power.9e
index 63da04546e..0133969362 100644
--- a/usr/src/man/man9e/power.9e
+++ b/usr/src/man/man9e/power.9e
@@ -3,7 +3,7 @@
.\" 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]
-.TH POWER 9E "Dec 12, 2003"
+.TH POWER 9E "Sep 16, 2016"
.SH NAME
power \- power a device attached to the system
.SH SYNOPSIS
@@ -18,13 +18,11 @@ power \- power a device attached to the system
.fi
.SH INTERFACE LEVEL
-.sp
.LP
Solaris DDI specific (Solaris DDI). This entry point is required. If the driver
writer does not supply this entry point, the value \fBNULL\fR must be used in
-the \fBcb_ops\fR(9S) structure instead.
+the \fBdev_ops\fR(9S) structure instead.
.SH PARAMETERS
-.sp
.ne 2
.na
\fB\fIdip\fR\fR
@@ -52,7 +50,6 @@ Desired component power level.
.RE
.SH DESCRIPTION
-.sp
.LP
The \fBpower\fR(9E) function is the device-specific Power Management entry
point. This function is called when the system wants the driver to set the
@@ -85,7 +82,6 @@ If the system requests an inappropriate power transition for the device (for
example, a request to power down a device which has just become busy), then the
power level should not be changed and power should return \fBDDI_FAILURE\fR.
.SH RETURN VALUES
-.sp
.LP
The \fBpower()\fR function returns:
.sp
@@ -107,11 +103,9 @@ Failed to set the power to the requested \fIlevel\fR.
.RE
.SH CONTEXT
-.sp
.LP
The \fBpower()\fR function is called from user or kernel context only.
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -127,10 +121,9 @@ Interface stability Committed
.TE
.SH SEE ALSO
-.sp
.LP
\fBattach\fR(9E), \fBdetach\fR(9E), \fBpm_busy_component\fR(9F),
-\fBpm_idle_component\fR(9F), \fBpm_raise_power\fR(9F), \fBcb_ops\fR(9S)
+\fBpm_idle_component\fR(9F), \fBpm_raise_power\fR(9F), \fBdev_ops\fR(9S)
.sp
.LP
\fIWriting Device Drivers\fR
diff --git a/usr/src/man/man9f/rmalloc.9f b/usr/src/man/man9f/rmalloc.9f
index fc522fcfbe..bf60744bed 100644
--- a/usr/src/man/man9f/rmalloc.9f
+++ b/usr/src/man/man9f/rmalloc.9f
@@ -3,7 +3,7 @@
.\" 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]
-.TH RMALLOC 9F "Jan 16, 2006"
+.TH RMALLOC 9F "Nov 11, 2016"
.SH NAME
rmalloc \- allocate space from a resource map
.SH SYNOPSIS
@@ -45,7 +45,8 @@ Number of units of the resource.
.LP
The \fBrmalloc()\fR function is used by a driver to allocate space from a
previously defined and initialized resource map. The map itself is allocated by
-calling the function \fBrmallocmap\fR(9F). \fBrmalloc()\fR is one of five
+calling the function \fBrmallocmap\fR(9F) or \fBrmallocmap_wait\fR(9F).
+\fBrmalloc()\fR is one of six
functions used for resource map management. The other functions include:
.sp
.ne 2
@@ -77,6 +78,15 @@ Allocate a resource map and initialize it.
.sp
.ne 2
.na
+\fB\fBrmallocmap_wait\fR(9F)\fR
+.ad
+.RS 20n
+Allocate a resource map and initialize it. Wait if necessary.
+.RE
+
+.sp
+.ne 2
+.na
\fB\fBrmfreemap\fR(9F)\fR
.ad
.RS 20n
@@ -119,8 +129,8 @@ illustrates the following procedures:
.TP
.ie t \(bu
.el o
-Panics the system if the required amount of memory can not be allocated (lines
-11-15).
+Returns error if the required amount of memory can not be allocated (lines
+9-17).
.RE
.RS +4
.TP
@@ -132,35 +142,37 @@ and \fBrmfree\fR(9F) to initialize the total resource area.
.sp
.in +2
.nf
-1 #define XX_MAPSIZE 12
-2 #define XX_BUFSIZE 2560
-3 static struct map *xx_mp; /* Private buffer space map */
+1 #define XX_MAPSIZE 12
+2 #define XX_SIZE 2560
+3 #define XX_BUFSIZE (XX_MAPSIZE * XX_SIZE)
+4
+5 static struct map *xx_mp; /* Resource map */
+6 static void *bp; /* Private buffer */
.\|.\|.
-4 xxstart(\|)
-5 /*
-6 * Allocate private buffer. If insufficient memory,
-7 * display message and halt system.
-8 */
-9 {
-10 register caddr_t bp;
+7 xxstart(\|)
+8 {
.\|.\|.
-11 if ((bp = kmem_alloc(XX_BUFSIZE, KM_NOSLEEP) == 0) {
-12
-13 cmn_err(CE_PANIC, "xxstart: kmem_alloc failed before %d buffer"
-14 "allocation", XX_BUFSIZE);
-15 }
-16
-17 /*
-18 * Initialize the resource map with number
-19 * of slots in map.
-20 */
-21 xx_mp = rmallocmap(XX_MAPSIZE);
-22
-24 /*
-25 * Initialize space management map with total
-26 * buffer area it is to manage.
-27 */
-28 rmfree(xx_mp, XX_BUFSIZE, bp);
+9 /*
+10 * Allocate private buffer. If insufficient memory,
+11 * display message and return error.
+12 */
+13 if ((bp = kmem_alloc(XX_BUFSIZE, KM_NOSLEEP) == NULL) {
+14 cmn_err(CE_WARN, "xxstart: kmem_alloc failed for %d bytes",
+15 XX_BUFSIZE);
+16 return (ENOMEM);
+17 }
+18
+19 /*
+20 * Allocate the resource map with number
+21 * of slots in map.
+22 */
+23 xx_mp = rmallocmap(XX_MAPSIZE);
+24
+25 /*
+26 * Initialize the resource map with total
+27 * area it is to manage.
+28 */
+29 rmfree(xx_mp, XX_MAPSIZE, 1);
.\|.\|.\fI\fR
.fi
.in -2
@@ -184,21 +196,35 @@ The next example illustrates the following procedures:
.ie t \(bu
.el o
The size of the \fBI/O\fR request is calculated and stored in the \fIsize\fR
-variable (line 10).
+variable (line 16).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+The number of the resource units needed is calculated and stored in the
+\fIcnt\fR variable (line 19).
+.RE
+.RS +4
+.TP
+.ie t \(bu
+.el o
+Space is allocated from the resource map through the \fBrmalloc()\fR function
+using the \fIcnt\fR value (line 25). If the allocation fails return error.
.RE
.RS +4
.TP
.ie t \(bu
.el o
-Buffers are allocated through the \fBrmalloc()\fR function using the \fIsize\fR
-value (line 15). If the allocation fails the system will panic.
+The buffer address is calculated and stored in the \fIaddr\fR variable
+(line 31).
.RE
.RS +4
.TP
.ie t \(bu
.el o
The \fBuiomove\fR(9F) function is used to move data to the allocated buffer
-(line 23).
+(line 37).
.RE
.RS +4
.TP
@@ -211,34 +237,48 @@ returned.
.sp
.in +2
.nf
-1 #define XX_BUFSIZE 2560
-2 #define XX_MAXSIZE (XX_BUFSIZE / 4)
-3
-4 static struct map *xx_mp; /* Private buffer space map */
+1 #define XX_MAPSIZE 12
+2 #define XX_SIZE 2560
+3 #define XX_BUFSIZE (XX_MAPSIZE * XX_SIZE)
+4 #define XX_MAXSIZE (XX_BUFSIZE / 4)
+5
+6 static struct map *xx_mp; /* Resource map */
+7 static void *bp; /* Private buffer */
...
-5 xxread(dev_t dev, uio_t *uiop, cred_t *credp)
-6 {
-7
-8 register caddr_t addr;
-9 register int size;
-10 size = min(COUNT, XX_MAXSIZE); /* Break large I/O */
-11 /* request into small ones */
-12 /*
-13 * Get buffer.
-14 */
-15 if ((addr = (caddr_t)rmalloc(xx_mp, size)) == 0)
-16 cmn_err(CE_PANIC, "read: rmalloc failed allocation of size %d",
-17 size);
+8 xxread(dev_t dev, uio_t *uiop, cred_t *credp)
+9 {
+10
+11 void *addr;
+12 size_t size;
+13 unsigned long idx;
+14 unsigned long cnt;
+15
+16 size = min(COUNT, XX_MAXSIZE); /* Break large I/O */
+17 /* request into small ones */
18
-19 /*
-20 * Move data to buffer. If invalid address is found,
-21 * return buffer to map and return error code.
-22 */
-23 if (uiomove(addr, size, UIO_READ, uiop) == -1) {
-24 rmfree(xx_mp, size, addr);
-25 return(EFAULT);
-26 }
-27 }\fI\fR
+19 cnt = size / XX_SIZE; /* Calculate the number of */
+20 /* chunks needed */
+21
+22 /*
+23 * Get the buffer index.
+24 */
+25 if ((idx = rmalloc(xx_mp, cnt)) == 0)
+26 return (ENOMEM);
+27
+28 /*
+29 * Get the buffer address.
+30 */
+31 addr = bp + (idx - 1) * XX_SIZE;
+32
+33 /*
+34 * Move data to buffer. If invalid address is found,
+35 * return buffer to map and return error code.
+36 */
+37 if (uiomove(addr, size, UIO_READ, uiop) == -1) {
+38 rmfree(xx_mp, cnt, idx);
+39 return (EFAULT);
+40 }
+41 }\fI\fR
.fi
.in -2
@@ -246,6 +286,7 @@ returned.
.sp
.LP
\fBkmem_alloc\fR(9F), \fBrmalloc_wait\fR(9F), \fBrmallocmap\fR(9F),
+\fBrmallocmap_wait\fR(9F),
\fBrmfree\fR(9F), \fBrmfreemap\fR(9F), \fBuiomove\fR(9F)
.sp
.LP
diff --git a/usr/src/man/man9f/usb_get_max_pkts_per_isoc_request.9f b/usr/src/man/man9f/usb_get_max_pkts_per_isoc_request.9f
index 108cb44838..021b94c58e 100644
--- a/usr/src/man/man9f/usb_get_max_pkts_per_isoc_request.9f
+++ b/usr/src/man/man9f/usb_get_max_pkts_per_isoc_request.9f
@@ -3,7 +3,7 @@
.\" 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]
-.TH USB_GET_MAX_PKTS_PER_ISOC_REQUEST 9F "Jan 5, 2004"
+.TH USB_GET_MAX_PKTS_PER_ISOC_REQUEST 9F "Nov 10, 2016"
.SH NAME
usb_get_max_pkts_per_isoc_request \- Get maximum number of packets allowed per
isochronous request
@@ -18,11 +18,9 @@ isochronous request
.fi
.SH INTERFACE LEVEL
-.sp
.LP
Solaris DDI specific (Solaris DDI)
.SH PARAMETERS
-.sp
.ne 2
.na
\fB\fIdip\fR\fR
@@ -32,7 +30,6 @@ Pointer to the device's \fBdev_info\fR structure.
.RE
.SH DESCRIPTION
-.sp
.LP
The \fBusb_get_max_pkts_per_isoc_request()\fR function returns the maximum
number of isochronous packets per request that the host control driver can
@@ -50,17 +47,14 @@ max = usb_get_max_pkts_per_isoc_request(dip) * endpoint_max_packet_size;
where endpoint_max_packet_size is the wMaxPacketSize field of the isochronous
endpoint over which the transfer will take place.
.SH RETURN VALUES
-.sp
.LP
-On success, the \fBusb_get_current_frame_number()\fR function returns the
+On success, the \fBusb_get_max_pkts_per_isoc_request()\fR function returns the
maximum number of isochronous pkts per request. On failure it returns \fB0\fR.
The function fails if \fIdip\fR is NULL.
.SH CONTEXT
-.sp
.LP
May be called from user, kernel or interrupt context.
.SH EXAMPLES
-.sp
.in +2
.nf
/*
@@ -103,7 +97,6 @@ if (usb_pipe_isoc_xfer(pipe, isoc_req, USB_FLAGS_NOSLEEP) != USB_SUCCESS) {
.in -2
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -121,7 +114,6 @@ Interface stability Committed
.TE
.SH SEE ALSO
-.sp
.LP
\fBattributes\fR(5), \fBusb_pipe_isoc_xfer\fR(9F), \fBusb_alloc_request\fR(9F),
\fBusb_get_current_frame_number\fR(9F). \fBusb_ep_descr\fR(9S),
diff --git a/usr/src/pkg/manifests/system-file-system-zfs-tests.mf b/usr/src/pkg/manifests/system-file-system-zfs-tests.mf
index a9afe1fa0b..43ec74d44f 100644
--- a/usr/src/pkg/manifests/system-file-system-zfs-tests.mf
+++ b/usr/src/pkg/manifests/system-file-system-zfs-tests.mf
@@ -21,7 +21,7 @@
#
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2012, 2015 by Delphix. All rights reserved.
#
set name=pkg.fmri value=pkg:/system/file-system/zfs/tests@$(PKGVERS)
@@ -54,6 +54,7 @@ $(i386_ONLY)file path=usr/bin/$(ARCH32)/zlook mode=0555
$(i386_ONLY)file path=usr/bin/$(ARCH32)/ztest mode=0555
file path=usr/bin/$(ARCH64)/zlook mode=0555
file path=usr/bin/$(ARCH64)/ztest mode=0555
+file path=usr/bin/zloop mode=0555
file path=usr/include/sys/fs/zut.h
file path=usr/lib/devfsadm/linkmod/SUNW_zut_link.so group=sys
$(i386_ONLY)file path=usr/sbin/$(ARCH32)/zhack mode=0555
diff --git a/usr/src/uts/common/fs/zfs/zvol.c b/usr/src/uts/common/fs/zfs/zvol.c
index 535bc057b9..35ae5a8fd1 100644
--- a/usr/src/uts/common/fs/zfs/zvol.c
+++ b/usr/src/uts/common/fs/zfs/zvol.c
@@ -24,7 +24,7 @@
* Portions Copyright 2010 Robert Milkowski
*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2016 by Delphix. All rights reserved.
* Copyright (c) 2014, Joyent, Inc. All rights reserved.
* Copyright (c) 2014 Integros [integros.com]
*/
@@ -154,6 +154,12 @@ int zvol_maxphys = DMU_MAX_ACCESS/2;
*/
boolean_t zvol_unmap_enabled = B_TRUE;
+/*
+ * If true, unmaps requested as synchronous are executed synchronously,
+ * otherwise all unmaps are asynchronous.
+ */
+boolean_t zvol_unmap_sync_enabled = B_FALSE;
+
extern int zfs_set_prop_nvlist(const char *, zprop_source_t,
nvlist_t *, nvlist_t *);
static int zvol_remove_zv(zvol_state_t *);
@@ -1912,26 +1918,21 @@ zvol_ioctl(dev_t dev, int cmd, intptr_t arg, int flag, cred_t *cr, int *rvalp)
zfs_range_unlock(rl);
- if (error == 0) {
- /*
- * If the write-cache is disabled or 'sync' property
- * is set to 'always' then treat this as a synchronous
- * operation (i.e. commit to zil).
- */
- if (!(zv->zv_flags & ZVOL_WCE) ||
- (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS))
- zil_commit(zv->zv_zilog, ZVOL_OBJ);
-
- /*
- * If the caller really wants synchronous writes, and
- * can't wait for them, don't return until the write
- * is done.
- */
- if (df.df_flags & DF_WAIT_SYNC) {
- txg_wait_synced(
- dmu_objset_pool(zv->zv_objset), 0);
- }
+ /*
+ * If the write-cache is disabled, 'sync' property
+ * is set to 'always', or if the caller is asking for
+ * a synchronous free, commit this operation to the zil.
+ * This will sync any previous uncommitted writes to the
+ * zvol object.
+ * Can be overridden by the zvol_unmap_sync_enabled tunable.
+ */
+ if ((error == 0) && zvol_unmap_sync_enabled &&
+ (!(zv->zv_flags & ZVOL_WCE) ||
+ (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS) ||
+ (df.df_flags & DF_WAIT_SYNC))) {
+ zil_commit(zv->zv_zilog, ZVOL_OBJ);
}
+
return (error);
}