aboutsummaryrefslogtreecommitdiff
path: root/cddl
Commit message (Collapse)AuthorAgeFilesLines
* Enable creation of static userspace probes in incremental builds.Mark Johnston2020-08-204-69/+89
| | | | | | | | | | | | | | | | | | To define USDT probes, dtrace -G makes use of relocations for undefined symbols: the target address is overwritten with NOPs and the location is recorded in the DOF section of the output object file. To avoid link errors, the original relocation is destroyed. However, this means that the same input object file cannot be processed multiple times, as happens during incremental rebuilds. Instead, only set the relocation type to NONE, so that all information required to reconstruct USDT probes is preserved. Reported by: bdrewery MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=364438
* Remove non-FreeBSD ifdefs from dt_link.c.Mark Johnston2020-08-201-250/+19
| | | | | | | | | | | | This file is too complicated as it is and has diverged a fair bit from illumos due to toolchain differences, so just drop unused code (including SPARC support). MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=364437
* zfs: fix EIO accessing dataset after resuming interrupted receiveAlan Somers2020-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | ZFS unmounts a dataset while receiving into it and remounts it afterwards. But if ZFS is resuming an incomplete receive, it screws up and ends up with a dataset that is mounted, but returns EIO for every access. This commit fixes that condition. While the vulnerable code also exists in OpenZFS, the problem is not reproducible there. Apparently OpenZFS doesn't unmount the destination dataset during receive, like FreeBSD does. PR: 248606 Reviewed by: mmacy MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D26034 Notes: svn path=/head/; revision=364412
* Fix libdtrace build with zsh as /bin/shAlex Richardson2020-08-114-54/+46
| | | | | | | | | | | | When zsh runs in POSIX sh mode it does not support the -e flag to echo. Use printf instead of echo to avoid the "-e" characters being printed. Obtained from: CheriBSD Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D26026 Notes: svn path=/head/; revision=364124
* Fix -DBUILD_WITH_STRICT_TMPPATH dtrace buildsAlex Richardson2020-08-114-0/+4
| | | | | | | | | | | | | | | | | | | Some of the scripts used for libdtrace invoke nawk instead of awk (for example cddl/contrib/opensolaris/lib/libdtrace/common/mknames.sh). When bootstrapping all tools, we get the nawk -> awk link while building usr.bin/awk, but when linking/copying the dependencies from the host we were only adding awk but not nawk. This was silently generating invalid files when building libdtrace with BUILD_WITH_STRICT_TMPPATH=1 since those scripts invoke nawk instead of awk. In addition to adding the missing link this commit also adds set -e to those scripts to catch errors like this in the future. Reviewed By: markj, emaste Differential Revision: https://reviews.freebsd.org/D26025 Notes: svn path=/head/; revision=364123
* Fix cddl tools bootstrapping on macOS and LinuxAlex Richardson2020-08-072-0/+11
| | | | | | | | Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D25979 Notes: svn path=/head/; revision=364022
* ctfmerge: Fix missing pthread_cond_init()Alex Richardson2020-08-061-0/+1
| | | | | | | | | | | | | This does not appear to matter on FreeBSD or Linux, but when building an amd64 kernel on macOS I was seeing infinite loops in ctfmerge. It turns out the loop in wip_save_work() was looping forever due to pthread_cond_wait() always returning -EINVAL. Reviewed By: markj, brooks Differential Revision: https://reviews.freebsd.org/D25973 Notes: svn path=/head/; revision=363991
* MFOpenZFS: Add support for boot environment data to be stored in the labelToomas Soome2020-08-055-6/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are building new bootonce mechanism (previously zfs bootnext) and it is based on this OpenZFS change. Since this patch is nicely self contained, I am commiting it as is, and we can stack our changes. Original patch description follows: Modern bootloaders leverage data stored in the root filesystem to enable some of their powerful features. GRUB specifically has a grubenv file which can store large amounts of configuration data that can be read and written at boot time and during normal operation. This allows sysadmins to configure useful features like automated failover after failed boot attempts. Unfortunately, due to the Copy-on-Write nature of ZFS, the standard behavior of these tools cannot handle writing to ZFS files safely at boot time. We need an alternative way to store data that allows the bootloader to make changes to the data. This work is very similar to work that was done on Illumos to enable similar functionality in the FreeBSD bootloader. This patch is different in that the data being stored is a raw grubenv file; this file can store arbitrary variables and values, and the scripting provided by grub is powerful enough that special structures are not required to implement advanced behavior. We repurpose the second padding area in each label to store the grubenv file, protected by an embedded checksum. We add two ioctls to get and set this data, and libzfs_core and libzfs functions to access them more easily. There are no direct command line interfaces to these functions; these will be added directly to the bootloader utilities. Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com> Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Paul Dagnelie <pcd@delphix.com> Closes #10009 Obtained from: OpenZFS Sponsored by: Netflix, Klara Inc. Notes: svn path=/head/; revision=363911
* - Cleanups related to sparc64 removal.Yoshihiro Takahashi2020-07-283-12/+2
| | | | | | | | | | - Remove remains of sparc64 files. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D25831 Notes: svn path=/head/; revision=363644
* MFOpenZFS: Fix zpool history unbounded memory usageMark Johnston2020-07-233-26/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In original implementation, zpool history will read the whole history before printing anything, causing memory usage goes unbounded. We fix this by breaking it into read-print iterations. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Matt Ahrens <matt@delphix.com> Reviewed-by: Igor Kozhukhov <igor@dilos.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chunwei Chen <david.chen@nutanix.com> Closes #9516 Note, this change changes the libzfs.so ABI by modifying the prototype of zpool_get_history(). Since libzfs is effectively private to the base system it is anticipated that this will not be a problem. PR: 247557 Obtained from: OpenZFS Reported and tested by: Sam Vaughan <samjvaughan@gmail.com> Discussed with: freqlabs MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25745 openzfs/zfs@7125a109dcc55628336ff3f58e59e503f4d7694d Notes: svn path=/head/; revision=363447
* zpool(8): Fix a few typos regarding 'inverval' -> 'interval'Gordon Bergling2020-07-201-3/+3
| | | | | | | | | | | PR: 248068 Submitted by: PauAmma <pauamma at gundo dot com> Reviewed by: bcr (mentor) Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D25719 Notes: svn path=/head/; revision=363362
* zpool-features(7): Note that the boot loader has support for large_blocksAllan Jude2020-07-151-4/+3
| | | | | | | | | | | | | | Since r304321 (-current: Aug 18, 2016) and r328866 (stable/11: Feb 5, 2018) the FreeBSD loader has supported reading from datasets with the large_blocks feature active. PR: 247992 Reported by: Anton Saietskii <vsasjason@gmail.com> MFC after: 2 weeks Sponsored by: Klara Inc. Notes: svn path=/head/; revision=363224
* Fix a Wvoid-pointer-to-enum-cast warning missed in r359978.Brooks Davis2020-07-061-1/+1
| | | | | | | | | | | | | | | This pattern is used in callbacks with void * data arguments and seems both relatively uncommon and relatively harmless. Silence the warning by casting through uintptr_t. This warning is on by default in Clang 11. MFC after: 3 days Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24425 Notes: svn path=/head/; revision=362979
* MFOpenZFS: Add basic zfs ioc input nvpair validationToomas Soome2020-06-234-13/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want newer versions of libzfs_core to run against an existing zfs kernel module (i.e. a deferred reboot or module reload after an update). Programmatically document, via a zfs_ioc_key_t, the valid arguments for the ioc commands that rely on nvpair input arguments (i.e. non legacy commands from libzfs_core). Automatically verify the expected pairs before dispatching a command. This initial phase focuses on the non-legacy ioctls. A follow-on change can address the legacy ioctl input from the zfs_cmd_t. The zfs_ioc_key_t for zfs_keys_channel_program looks like: static const zfs_ioc_key_t zfs_keys_channel_program[] = { {"program", DATA_TYPE_STRING, 0}, {"arg", DATA_TYPE_UNKNOWN, 0}, {"sync", DATA_TYPE_BOOLEAN_VALUE, ZK_OPTIONAL}, {"instrlimit", DATA_TYPE_UINT64, ZK_OPTIONAL}, {"memlimit", DATA_TYPE_UINT64, ZK_OPTIONAL}, }; Introduce four input errors to identify specific input failures (in addition to generic argument value errors like EINVAL, ERANGE, EBADF, and E2BIG). ZFS_ERR_IOC_CMD_UNAVAIL the ioctl number is not supported by kernel ZFS_ERR_IOC_ARG_UNAVAIL an input argument is not supported by kernel ZFS_ERR_IOC_ARG_REQUIRED a required input argument is missing ZFS_ERR_IOC_ARG_BADTYPE an input argument has an invalid type Reviewed by: allanjude Obtained from: OpenZFS Sponsored by: Netflix, Klara Inc. Differential Revision: https://reviews.freebsd.org/D25393 Notes: svn path=/head/; revision=362531
* ZFS: Allow setting checksum=skein on boot poolsAllan Jude2020-06-192-3/+6
| | | | | | | | | PR: 245889 Reported by: delphij Sponsored by: Klara Inc. Notes: svn path=/head/; revision=362396
* Add HISTORY sections to ZFS and dtrace manpageGordon Bergling2020-06-146-5/+35
| | | | | | | | | | Reviewed by: bcr (mentor) Approved by: bcr (mentor) MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D23833 Notes: svn path=/head/; revision=362170
* Restore the binary compatibility for link_map l_addr.Konstantin Belousov2020-05-211-1/+7
| | | | | | | | | | | | | | | | | Keep link_map l_addr binary layout compatible, rename l_addr to l_base where rtld returns map base. Provide relocbase in newly added l_addr. This effectively reverts the patch to the initial version of D24918. Reported by: antoine (portmgr) Reviewed by: jhb, markj Tested by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24946 Notes: svn path=/head/; revision=361349
* zfs allow/unallow should work with numeric uid/gidAndriy Gapon2020-05-121-5/+13
| | | | | | | | | | | | | | | | And that should work even (especially) if there is no matching user or group name. This change allows to see and modify delegations for deleted groups and users. The change is originally by Xin Li. illumos report: https://www.illumos.org/issues/6037 OpenZFS (ZoL) PR: https://github.com/openzfs/zfs/pull/10280 Obtained from: delphij MFC after: 2 weeks Notes: svn path=/head/; revision=360956
* dtrace tests: Support globbing for excludesBryan Drewery2020-04-292-3/+20
| | | | | | | | | | | Downstream this makes skipping tests like common/ip/tst.*sctp*.ksh simpler. Reviewed by: vangyzen, cem, markj Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D24608 Notes: svn path=/head/; revision=360476
* Revert r360445Bryan Drewery2020-04-282-8/+10
| | | | | | | | I did not intend to commit this yet as more work is needed for non-amd64 kernels. Notes: svn path=/head/; revision=360448
* ctfmerge: Assert that there is enough room for types.Bryan Drewery2020-04-282-10/+8
| | | | | | | | Sponsord by: Dell EMC Differential Revision: https://reviews.freebsd.org/D24537 Notes: svn path=/head/; revision=360445
* zfs-program.8: fix orphan .XrAlan Somers2020-04-181-2/+2
| | | | | | | | | | Reported by: phk Reviewed by: avg MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24488 Notes: svn path=/head/; revision=360080
* zfsd.8: fix orphan .XrAlan Somers2020-04-181-6/+3
| | | | | | | | | | Though ZFS is a kernel module, it has no man page in section 4. Reported by: phk MFC after: 2 weeks Notes: svn path=/head/; revision=360077
* zfs: Add option for forcible unmounting dataset while receiving snapshot.Mariusz Zaborski2020-04-114-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently when the dataset is in use we can't receive snapshots. zfs send test/1@asd | zfs recv -FM test/2 cannot unmount '/test/2': Device busy This commits add option 'M' which attempts to forcibly unmount the dataset. Thanks to this we can enforce receiving snapshots in a single step. Note that this functionality is not supported on Linux because the VFS will prevent active mounted filesystems from being unmounted, even with the force option. This is the intended VFS behavior. Discussed-with: Pawel Jakub Dawidek <pjd@FreeBSD.org> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Allan Jude <allanjude@freebsd.org> Differential Revision: https://reviews.freebsd.org/D22306 openzfs/zfs@a57d3d45d6efdff935421e2ef3f97e3dc089d93d Notes: svn path=/head/; revision=359808
* zfs: fix -fno-common issuesKyle Evans2020-03-283-2/+4
| | | | | | | | | | | A similar (or identical?) fix has already landed in OpenZFS. -fno-common will become the default in GCC10/LLVM11. MFC after: 3 days Notes: svn path=/head/; revision=359397
* MFOpenZFS: ZVOLs should not be allowed to have childrenRyan Moeller2020-03-254-5/+44
| | | | | | | | | | | | | | | | | | | | | | | | zfs create, receive and rename can bypass this hierarchy rule. Update both userland and kernel module to prevent this issue and use pyzfs unit tests to exercise the ioctls directly. Note: this commit slightly changes zfs_ioc_create() ABI. This allow to differentiate a generic error (EINVAL) from the specific case where we tried to create a dataset below a ZVOL (ZFS_ERR_WRONG_PARENT). Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Matt Ahrens <mahrens@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tom Caputi <tcaputi@datto.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Approved by: mav (mentor) MFC after: 2 weeks Sponsored by: iXsystems, Inc. openzfs/zfs@d8d418ff0cc90776182534bce10b01e9487b63e4 Notes: svn path=/head/; revision=359303
* MFOpenZFS: make zil max block size tunableAlexander Motin2020-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've observed that on some highly fragmented pools, most metaslab allocations are small (~2-8KB), but there are some large, 128K allocations. The large allocations are for ZIL blocks. If there is a lot of fragmentation, the large allocations can be hard to satisfy. The most common impact of this is that we need to check (and thus load) lots of metaslabs from the ZIL allocation code path, causing sync writes to wait for metaslabs to load, which can take a second or more. In the worst case, we may not be able to satisfy the allocation, in which case the ZIL will resort to txg_wait_synced() to ensure the change is on disk. To provide a workaround for this, this change adds a tunable that can reduce the size of ZIL blocks. External-issue: DLPX-61719 Reviewed-by: George Wilson <george.wilson@delphix.com> Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matthew Ahrens <mahrens@delphix.com> Closes #8865 openzfs/zfs@b8738257c2607c73c731ce8e0fd73282b266d6ef MFC after: 2 weeks Notes: svn path=/head/; revision=359112
* Do not load dtraceall.ko if dtrace.ko is already loaded.Mark Johnston2020-02-281-1/+1
| | | | | | | | | | | | This was the intent of the existing code, but instead it would unconditionally load dtraceall.ko because of a stale errno value. Reported by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=358435
* sack_newdata and snd_recover hold the same value. Therefore, use onlyMichael Tuexen2020-02-131-1/+1
| | | | | | | | | | a single instance: use snd_recover also where sack_newdata was used. Submitted by: Richard Scheffenegger Differential Revision: https://reviews.freebsd.org/D18811 Notes: svn path=/head/; revision=357858
* [PowerPC] [DTrace] Add ELFv2 support in libdtraceBrandon Bergren2020-02-051-4/+10
| | | | | | | | | | | | | | | PPC64 ELFv2 acts like a "normal" platform in that it no longer needs function descriptors. So, ensure we are only enabling them on ELFv1. Additionally, ELFv2 requires that the ELF header have a nonzero e_flags, so ensure that the synthesized ELF header in dt_link.c is setting it. Reviewed by: jhibbits, markj Approved by: gnn Differential Revision: https://reviews.freebsd.org/D22403 Notes: svn path=/head/; revision=357590
* Speed up "zpool import" in the presence of many zvolsAlan Somers2020-01-281-0/+12
| | | | | | | | | | | | | | | | | | | By default, zpools may not be backed by zvols (that can be changed with the "vfs.zfs.vol.recursive" sysctl). When that sysctl is set to 0, the kernel does not attempt to read zvols when looking for vdevs. But the zpool command still does. This change brings the zpool command into line with the kernel's behavior. It speeds "zpool import" when an already imported pool has many zvols, or a zvol with many snapshots. PR: 241083 Reported by: Martin Birgmeier <d8zNeCFG@aon.at> Reviewed by: mav, Ryan Moeller <ryan@freqlabs.com> MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D22077 Notes: svn path=/head/; revision=357235
* libzfs: add zfs_mount_atKyle Evans2020-01-192-5/+27
| | | | | | | | | | | | | | | | | | | | | | This will be used in libbe in place of the internal zmount(); libbe only wants to be able to mount a dataset at an arbitrary mountpoint without altering dataset/pool properties. The natural way to do this in a portable way is by creating a zfs_mount_at() interface that's effectively zfs_mount() + a mountpoint parameter. zfs_mount() is now a light wrapper around the new method. The interface and implementation have already been accepted into ZFS On Linux, and the next commit to switch libbe() over to this new interface will solve the last compatibility issue with ZoL. The next sysutils/openzfs rebase against ZoL should be able to build libbe/bectl with only minor adjustments to build glue. Reviewed by: Ryan Moeller <ryan freqlabs com> MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D23132 Notes: svn path=/head/; revision=356876
* Use a deterministic hash for USDT symbol names.Mark Johnston2020-01-071-5/+22
| | | | | | | | | | | | | | Previously libdtrace used ftok(3), which hashes the inode number of the input object file. To increase reproducibility of builds that embed USDT probes, include a hash of the object file path in the symbol name instead. Reported and tested by: bdrewery Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=356477
* vfs: add a file missed in r356337Mateusz Guzik2020-01-031-1/+1
| | | | Notes: svn path=/head/; revision=356338
* Add libdtrace support for arm64 USDT probes.Mark Johnston2019-12-291-8/+70
| | | | | | | | | | | | | arm64 is still lacking a fasttrap implementation, which is required to actually enable userland probes, but this at least allows USDT probes to be linked into userland applications. Submitted by: Klaus Küchemann <maciphone2@googlemail.com> (original) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D22360 Notes: svn path=/head/; revision=356187
* dtrace: avoid gcc9 Walloca-larger-thanRyan Libby2019-12-211-21/+47
| | | | | | | | | | | | gcc9 grew a new warning for unbounded allocas, such as the one in dt_options_load. Remove both uses of alloca in dt_options.c. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22880 Notes: svn path=/head/; revision=355973
* Update Makefile.depend filesSimon J. Gerraty2019-12-117-7/+0
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* libzpool: use CFLAGS.lz4.c to build lz4.o and lz4.picoToomas Soome2019-12-021-2/+1
| | | | | | | Clean up this Makefile a bit. Notes: svn path=/head/; revision=355291
* MFV r354383: 10592 misc. metaslab and vdev related ZoL bug fixesAndriy Gapon2019-11-212-132/+147
| | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@555d674d5d4b8191dc83723188349d28278b2431 https://github.com/illumos/illumos-gate/commit/555d674d5d4b8191dc83723188349d28278b2431 https://www.illumos.org/issues/10592 This is a collection of recent fixes from ZoL: 8eef997679b Error path in metaslab_load_impl() forgets to drop ms_sync_lock 928e8ad47d3 Introduce auxiliary metaslab histograms 425d3237ee8 Get rid of space_map_update() for ms_synced_length 6c926f426a2 Simplify log vdev removal code 21e7cf5da89 zdb -L should skip leak detection altogether df72b8bebe0 Rename range_tree_verify to range_tree_verify_not_present 75058f33034 Remove unused vdev_t fields Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com> Author: Serapheim Dimitropoulos <serapheim@delphix.com> MFC after: 4 weeks Notes: svn path=/head/; revision=354948
* MFV r354382,r354385: 10601 10757 Pool allocation classesAndriy Gapon2019-11-2111-268/+1169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@663207adb1669640c01c5ec6949ce78fd806efae https://github.com/illumos/illumos-gate/commit/663207adb1669640c01c5ec6949ce78fd806efae 10601 Pool allocation classes https://www.illumos.org/issues/10601 illumos port of ZoL Pool allocation classes. Includes at least these two commits: 441709695 Pool allocation classes misplacing small file blocks cc99f275a Pool allocation classes 10757 Add -gLp to zpool subcommands for alt vdev names https://www.illumos.org/issues/10757 Port from ZoL of d2f3e292d Add -gLp to zpool subcommands for alt vdev names Note that a subsequent ZoL commit changed -p to -P a77f29f93 Change full path subcommand flag from -p to -P Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com> Portions contributed by: Håkan Johansson <f96hajo@chalmers.se> Portions contributed by: Richard Yao <ryao@gentoo.org> Portions contributed by: Chunwei Chen <david.chen@nutanix.com> Portions contributed by: loli10K <ezomori.nozomu@gmail.com> Author: Don Brady <don.brady@delphix.com> 11541 allocation_classes feature must be enabled to add log device illumos/illumos-gate@c1064fd7ce62fe763a4475e9988ffea3b22137de https://github.com/illumos/illumos-gate/commit/c1064fd7ce62fe763a4475e9988ffea3b22137de https://www.illumos.org/issues/11541 After the allocation_classes feature was integrated, one can no longer add a log device to a pool unless that feature is enabled. There is an explicit check for this, but it is unnecessary in the case of log devices, so we should handle this better instead of forcing the feature to be enabled. Author: Jerry Jelinek <jerry.jelinek@joyent.com> FreeBSD notes. I faithfully added the new -g, -L, -P flags, but only -g does something: vdev GUIDs are displayed instead of device names. -L, resolve symlinks, and -P, display full disk paths, do nothing at the moment. The use of special vdevs is backward compatible for read-only access, so root pools should be bootable, but exercise caution. MFC after: 4 weeks Notes: svn path=/head/; revision=354941
* zpool.8: remove a paragraph about quorum disksAndriy Gapon2019-11-201-4/+0
| | | | | | | | | | | FreeBSD has no such thing. illumos and ZoL manuals do not talk about quorum disks either. Only Oracle ZFS mentions them. MFC after: 1 week Notes: svn path=/head/; revision=354886
* fix up r354804, resolve merge conflicts in zpool.8Andriy Gapon2019-11-201-39/+14
| | | | | | | | | | | | | Somehow I managed to commit the manual page with unresolved conflicts in it. While here, I also replaced .sp with .Pp. MFC after: 3 weeks X-MFC with: r354804 Notes: svn path=/head/; revision=354885
* Fix inconsistencies in anonymous DOF files.Mark Johnston2019-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The DOF file output by dtrace -A contains only the loadable sections. However, as it was created by a call to dtrace_dof_create() without flags, the original DOF was created with the loadable sections. The result is that the DOF includes the section headers for the unloadable sections (COMMENTS and UTSNAME) without these sections actually being present. This is inconsistent. A simple change to anon_prog() ensures that the missing sections are present in the outputted DOF. Alternatively, the call to dtrace_dof_create() could pass the DTRACE_D_STRIP flag stripping out the loadable sections. As the unloadable sections contain info useful for debugging purposes they haven't been stripped. Submitted by: Graeme Jenkinson <graeme.jenkinson@cl.cam.ac.uk> MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D21875 Notes: svn path=/head/; revision=354822
* fix up r354804, link zstreamdump with libzfsAndriy Gapon2019-11-181-1/+1
| | | | | | | | | | | | | | | | Since r354804 libzpool depends on libzfs for get_system_hostid symbol. Except for zstreamdump, all binaries linked with libzpool were already linked with libzfs. So, zstreamdump is the only fall-out. It's interesting that on amd64 not only I was able to successfully build zstreamdump, I am able to run it despite having the unresolved symbol in libzpool. MFC after: 4 weeks X-MFC with: r354804 Notes: svn path=/head/; revision=354806
* MFV r354378,r354379,r354386: 10499 Multi-modifier protection (MMP)Andriy Gapon2019-11-1816-231/+689
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 10499 Multi-modifier protection (MMP) illumos/illumos-gate@e0f1c0afa46cc84d4b1e40124032a9a87310386e https://github.com/illumos/illumos-gate/commit/e0f1c0afa46cc84d4b1e40124032a9a87310386e https://www.illumos.org/issues/10499 Port the following ZFS commits from ZoL to illumos. 379ca9cf2 Multi-modifier protection (MMP) bbffb59ef Fix multihost stale cache file import 0d398b256 Do not initiate MMP writes while pool is suspended 10701 Correct lock ASSERTs in vdev_label_read/write illumos/illumos-gate@58447f688d5e308373ab16a3b129bc0ba0fbc154 https://github.com/illumos/illumos-gate/commit/58447f688d5e308373ab16a3b129bc0ba0fbc154 https://www.illumos.org/issues/10701 Port of ZoL commit: 0091d66f4e Correct lock ASSERTs in vdev_label_read/write At a minimum, this fixes a blown assert during an MMP test run when running on a DEBUG build. 11770 additional mmp fixes illumos/illumos-gate@4348eb901228d2f8fa50bb132a34248e8662074e https://github.com/illumos/illumos-gate/commit/4348eb901228d2f8fa50bb132a34248e8662074e https://www.illumos.org/issues/11770 Port a few additional MMP fixes from ZoL that came in after our initial MMP port. 4ca457b065 ZTS: Fix mmp_interval failure ca95f70dff zpool import progress kstat (only minimal changes from above can be pulled in right now) 060f0226e6 MMP interval and fail_intervals in uberblock Note from the committer (me). I do not have any use for this feature and I have not tested it. I only did smoke testing with multihost=off. Please be aware. I merged the code only to make future merges easier. Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com> Portions contributed by: Tim Chase <tim@chase2k.com> Portions contributed by: sanjeevbagewadi <sanjeev.bagewadi@gmail.com> Portions contributed by: John L. Hammond <john.hammond@intel.com> Portions contributed by: Giuseppe Di Natale <dinatale2@llnl.gov> Portions contributed by: Prakash Surya <surya1@llnl.gov> Portions contributed by: Brian Behlendorf <behlendorf1@llnl.gov> Author: Olaf Faaland <faaland1@llnl.gov> MFC after: 4 weeks Notes: svn path=/head/; revision=354804
* fix zpool list property namesAndriy Gapon2019-11-071-7/+5
| | | | | | | | | | | | | This change is based on r354380 8899 zpool list property documentation doesn't match actual behaviour There is no "used" pool property, "alloc" is actually spelled "allocated". MFC after: 5 days Notes: svn path=/head/; revision=354437
* MFV r354377: 10554 Implemented zpool sync commandAndriy Gapon2019-11-076-11/+110
| | | | | | | | | | | | | | | | | | | | | illumos/illumos-gate@9c2acf00e275b6b2125a306f33cdddcc58393220 https://github.com/illumos/illumos-gate/commit/9c2acf00e275b6b2125a306f33cdddcc58393220 https://www.illumos.org/issues/10554 During the port of MMP (illumos bug 10499) from ZoL, I found this earlier ZoL project is a prerequisite. Here is the original description. This addition will enable us to sync an open TXG to the main pool on demand. The functionality is similar to 'sync(2)' but 'zpool sync' will return when data has hit the main storage instead of potentially just the ZIL as is the case with the 'sync(2)' cmd. Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com> Author: Alek Pinchuk <apinchuk@datto.com> MFC after: 3 weeks Relnotes: possibly Notes: svn path=/head/; revision=354436
* r354253 did miss the fact that libzpool is built as fake kernelToomas Soome2019-11-021-0/+2
| | | | | | | | We build libzpool as kernel like, use _FAKE_KERNEL check to include kernel api in libzpool. Notes: svn path=/head/; revision=354265
* Remove duplicate lz4 implementationsToomas Soome2019-11-021-1/+5
| | | | | | | | | | | | | | Port illumos change: https://www.illumos.org/issues/11667 Move lz4.c out of zfs tree to opensolaris/common/lz4, adjust it to be usable from kernel/stand/userland builds, so we can use just one single source. Add lz4.h to declare lz4_compress() and lz4_decompress(). MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D22037 Notes: svn path=/head/; revision=354253
* MFZoL: Avoid retrieving unused snapshot propsAlan Somers2019-10-266-32/+111
| | | | | | | | | | | | | | | | | | | | | This patch modifies the zfs_ioc_snapshot_list_next() ioctl to enable it to take input parameters that alter the way looping through the list of snapshots is performed. The idea here is to restrict functions that throw away some of the snapshots returned by the ioctl to a range of snapshots that these functions actually use. This improves efficiency and execution speed for some rollback and send operations. Reviewed-by: Tom Caputi <tcaputi@datto.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed by: Matt Ahrens <mahrens@delphix.com> Signed-off-by: Alek Pinchuk <apinchuk@datto.com> Closes #8077 zfsonlinux/zfs@4c0883fb4af0d5565459099b98fcf90ecbfa1ca1 MFC after: 2 weeks Notes: svn path=/head/; revision=354116