]> git.proxmox.com Git - mirror_zfs.git/log
mirror_zfs.git
3 years agoi-t: rewrite hooks
наб [Fri, 14 May 2021 04:47:53 +0000 (06:47 +0200)]
i-t: rewrite hooks

This produces a leaner image, doesn't fail if zdb doesn't exist,
properly handles hostnameless systems, doesn't mention crypto modules
for no reason, doesn't add useless empty executable in hopes an
eight-year-old PR is merged, uses i-t builtins for all copies

Also optimize the checkbashisms filter to spawn one (or a few) awks
instead of one per regular file and remove initramfs/hooks therefrom due
to a command -v false positive

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12017

3 years agoFix dmu_recv_stream test for resumable
Paul Zuchowski [Fri, 14 May 2021 04:46:14 +0000 (00:46 -0400)]
Fix dmu_recv_stream test for resumable

Use dsl_dataset_has_resume_receive_state()
not dsl_dataset_is_zapified() to check if
stream is resumable.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Alek Pinchuk <apinchuk@axcient.com>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
Closes #12034

3 years agoFreeBSD: Implement xattr=sa
Ryan Moeller [Thu, 29 Apr 2021 03:27:57 +0000 (03:27 +0000)]
FreeBSD: Implement xattr=sa

FreeBSD historically has not cared about the xattr property; it was
always treated as xattr=on.  With xattr=on, xattrs are stored as files
in a hidden xattr directory.  With xattr=sa, xattrs are stored as
system attributes and get cached in nvlists during xattr operations.
This makes SA xattrs simpler and more efficient to manipulate.  FreeBSD
needs to implement the SA xattr operations for feature parity with
Linux and to ensure that SA xattrs are accessible when migrated or
replicated from Linux.

Following the example set by Linux, refactor our existing extattr vnops
to split off the parts handling dir style xattrs, and add the
corresponding SA handling parts.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11997

3 years agoFreeBSD: Use SET_ERROR to trace xattr name errors
Ryan Moeller [Wed, 28 Apr 2021 19:19:28 +0000 (19:19 +0000)]
FreeBSD: Use SET_ERROR to trace xattr name errors

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11997

3 years agoFreeBSD: Don't force xattr mount option
Ryan Moeller [Wed, 28 Apr 2021 18:58:30 +0000 (18:58 +0000)]
FreeBSD: Don't force xattr mount option

The kernel will use the xattr property by default when not overridden
by a mount option.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11997

3 years agozed: Add Pushover notifier
Scott Colby [Thu, 13 May 2021 17:02:24 +0000 (13:02 -0400)]
zed: Add Pushover notifier

Add zed_notify_pushover to zed-functions.sh, along with the necessary
configuration variables in zed.rc.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Scott Colby <scott@scolby.com>
Closes #12012

3 years agoRevert "Fix raw sends on encrypted datasets when copying back snapshots"
Brian Behlendorf [Thu, 13 May 2021 17:00:17 +0000 (10:00 -0700)]
Revert "Fix raw sends on encrypted datasets when copying back snapshots"

Commit d1d4769 takes into account the encryption key version to
decide if the local_mac could be zeroed out. However, this could lead
to failure mounting encrypted datasets created with intermediate
versions of ZFS encryption available in master between major releases.
In order to prevent this situation revert d1d4769 pending a more
comprehensive fix which addresses the mount failure case.

Reviewed-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #11294
Issue #12025
Issue #12300
Closes #12033

3 years agoWiden mancheck target to all pages, fix them
наб [Mon, 10 May 2021 15:24:59 +0000 (17:24 +0200)]
Widen mancheck target to all pages, fix them

mandoc: ./man/man8/zfs-mount-generator.8.in:188:2:
        ERROR: skipping end of block that is not open: RE
mandoc: ./man/man8/zfs_ids_to_path.8:38:2:
        ERROR: skipping unknown macro: .LP
mandoc: ./man/man8/zfs_ids_to_path.8:48:2:
        ERROR: inserting missing end of block: Sh breaks Bl
mandoc: ./man/man8/zfs-wait.8:69:2:
        ERROR: skipping end of block that is not open: El
mandoc: ./man/man8/zfs-program.8:460:2:
        ERROR: inserting missing end of block: It breaks Bd
mandoc: ./man/man8/zfs-mount-generator.8:188:2:
        ERROR: skipping end of block that is not open: RE
mandoc: ./man/man8/zstream.8:43:2:
        ERROR: skipping unknown macro: .LP
mandoc: ./man/man8/zstream.8:107:2:
        ERROR: inserting missing end of block: Sh breaks Bl
mandoc: ./man/man8/zstream.8:107:2:
        ERROR: inserting missing end of block: Sh breaks Bl
make: *** [Makefile:1529: mancheck] Error 1

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue #12017

3 years agolibzfs: add keylocation=https://, backed by fetch(3) or libcurl
наб [Thu, 13 May 2021 04:21:35 +0000 (06:21 +0200)]
libzfs: add keylocation=https://, backed by fetch(3) or libcurl

Add support for http and https to the keylocation properly to
allow encryption keys to be fetched from the specified URL.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue #9543
Closes #9947
Closes #11956

3 years agoZTS: Add known exceptions
Brian Behlendorf [Wed, 12 May 2021 02:55:12 +0000 (19:55 -0700)]
ZTS: Add known exceptions

The following seven tests been observed to occasionally fail during
CI testing.  This commit adds them to the list of known somewhat
flaky test cases.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12023

3 years agolinux 5.13 compat: bdevops->revalidate_disk() removed
Coleman Kane [Wed, 12 May 2021 02:53:02 +0000 (22:53 -0400)]
linux 5.13 compat: bdevops->revalidate_disk() removed

Linux kernel commit 0f00b82e5413571ed225ddbccad6882d7ea60bc7 removes the
revalidate_disk() handler from struct block_device_operations. This
caused a regression, and this commit eliminates the call to it and the
assignment in the block_device_operations static handler assignment
code, when configure identifies that the kernel doesn't support that
API handler.

Reviewed-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Coleman Kane <ckane@colemankane.org>
Closes #11967
Closes #11977

3 years agoRemove unimplemented virus scanning hooks
Ryan Moeller [Tue, 11 May 2021 05:02:25 +0000 (01:02 -0400)]
Remove unimplemented virus scanning hooks

Reviewed-by: Adam Moss <c@yotes.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11972

3 years agomodule/zfs: remove zfs_zevent_console and zfs_zevent_cols
наб [Mon, 10 May 2021 18:00:15 +0000 (20:00 +0200)]
module/zfs: remove zfs_zevent_console and zfs_zevent_cols

zfs_zevent_console committed multiple printk()s per line without
properly continuing them ‒ a single event could easily be fragmented
across over thirty lines, making it useless for direct application

zfs_zevent_cols exists purely to wrap the output from zfs_zevent_console

The niche this was supposed to fill can be better served by something
akin to the all-syslog ZEDLET

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #7082
Closes #11996

3 years agolibzfs: zfs_asprintf(): don't return undefined pointer
наб [Mon, 3 May 2021 10:30:16 +0000 (12:30 +0200)]
libzfs: zfs_asprintf(): don't return undefined pointer

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11993

3 years agolibzfsbootenv: lzbe_set_boot_device(): don't free undefined pointer
наб [Mon, 3 May 2021 10:11:30 +0000 (12:11 +0200)]
libzfsbootenv: lzbe_set_boot_device(): don't free undefined pointer

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11993

3 years agozfs_get_enclosure_sysfs_path(): don't free undefined pointer
наб [Mon, 3 May 2021 10:13:20 +0000 (12:13 +0200)]
zfs_get_enclosure_sysfs_path(): don't free undefined pointer

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11993

3 years agozfs_get_enclosure_sysfs_path(): don't leak dev path
наб [Mon, 3 May 2021 10:01:13 +0000 (12:01 +0200)]
zfs_get_enclosure_sysfs_path(): don't leak dev path

Also always free tmp2 at the end

Before:
nabijaczleweli@tarta:~/uwu$ valgrind --leak-check=full ./blergh
==8947== Memcheck, a memory error detector
==8947== Using Valgrind-3.14.0 and LibVEX
==8947== Command: ./blergh
==8947==
(null)
==8947==
==8947== HEAP SUMMARY:
==8947==     in use at exit: 23 bytes in 1 blocks
==8947==   total heap usage: 3 allocs, 2 frees, 1,147 bytes allocated
==8947==
==8947== 23 bytes in 1 blocks are definitely lost in loss record 1 of 1
==8947==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==8947==    by 0x48D74B7: vasprintf (vasprintf.c:73)
==8947==    by 0x48B7833: asprintf (asprintf.c:35)
==8947==    by 0x401258: zfs_get_enclosure_sysfs_path
                         (zutil_device_path_os.c:191)
==8947==    by 0x401482: main (blergh.c:107)
==8947==
==8947== LEAK SUMMARY:
==8947==    definitely lost: 23 bytes in 1 blocks
==8947==    indirectly lost: 0 bytes in 0 blocks
==8947==      possibly lost: 0 bytes in 0 blocks
==8947==    still reachable: 0 bytes in 0 blocks
==8947==         suppressed: 0 bytes in 0 blocks
==8947==
==8947== For counts of detected and suppressed errors, rerun with: -v
==8947== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

nabijaczleweli@tarta:~/uwu$ sed -n 191p zutil_device_path_os.c
        tmpsize = asprintf(&tmp1, "/sys/block/%s/device", dev_name);

After:
nabijaczleweli@tarta:~/uwu$ valgrind --leak-check=full ./blergh
==9512== Memcheck, a memory error detector
==9512== Using Valgrind-3.14.0 and LibVEX
==9512== Command: ./blergh
==9512==
(null)
==9512==
==9512== HEAP SUMMARY:
==9512==     in use at exit: 0 bytes in 0 blocks
==9512==   total heap usage: 3 allocs, 3 frees, 1,147 bytes allocated
==9512==
==9512== All heap blocks were freed -- no leaks are possible
==9512==
==9512== For counts of detected and suppressed errors, rerun with: -v
==9512== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11993

3 years agozpool: vdev_run_cmd(): don't free undefined pointers
наб [Mon, 3 May 2021 09:36:02 +0000 (11:36 +0200)]
zpool: vdev_run_cmd(): don't free undefined pointers

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11993

3 years agolibzfs: zpool_load_compat(): don't free undefined pointers
наб [Fri, 30 Apr 2021 18:49:39 +0000 (20:49 +0200)]
libzfs: zpool_load_compat(): don't free undefined pointers

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11993

3 years agolibzfs: zpool_load_compat(): open feature file cloexec
наб [Thu, 29 Apr 2021 20:21:41 +0000 (22:21 +0200)]
libzfs: zpool_load_compat(): open feature file cloexec

As a bonus, this also passes the open flags into the open flags instead
of the mode (it worked by accident because O_RDONLY is 0),
correctly detects a failed map,
and prefaults the entire file since we're always writing to every page

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11993

3 years agocopy-builtin: posix conformance
illiliti [Sat, 8 May 2021 15:58:26 +0000 (15:58 +0000)]
copy-builtin: posix conformance

This commits contains changes to allow running `copy-builtin` without
bash + some minor improvements.

changed shebang to /bin/sh
added -f option to `set` to globally disable unneeded globbing
replaced all `echo` commands within add_after() with `printf`
alternative to avoid possible issues with options (-neE)
dropped non-portable superfluous `readlink` command
replaced superfluous `true` command with `:` builtin alternative
replaced non-portable `--recursive` option of `cp` command with `-R`
alternative
dropped non-portable `local` keyword

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: illiliti <illiliti@protonmail.com>
Closes #12004

3 years agoFix dRAID self-healing short columns
Brian Behlendorf [Sat, 8 May 2021 15:57:25 +0000 (08:57 -0700)]
Fix dRAID self-healing short columns

When dRAID performs a normal read operation only the data columns
in the raid map are read from disk.  This is enough information to
calculate the checksum, verify it, and return the needed data to the
application.  It's only in the event of a checksum failure that the
additional parity and any empty columns must be read since they are
required for parity reconstruction.

Reading these additional columns is handled by vdev_raidz_read_all()
which calls vdev_draid_map_alloc_empty() to expand the raid_map_t
and submit IOs for the missing columns.  This all works correctly,
but it fails to account for any "short" columns.  These are data
columns which are padded with a empty skip sector at the end.
Since that empty sector is not needed for a normal read it's not
read when columns is first read from disk.  However, like the parity
and empty columns the skip sector is needed to perform reconstruction.

The fix is to mark any "short" columns as never being read by clearing
the rc_tried flag when expanding the raid_map_t.  This will cause
the entire column to re-read from disk in the event of a checksum
failure allowing the self-healing functionality to repair the block.

Note that this only effects the self-healing feature because when
scrubbing a pool the parity, data, and empty columns are all read
initially to verify their contents.  Furthermore, only blocks which
contain "short" columns would be effected, and only when the memory
backing the skip sector wasn't already zeroed out.

This change extends the existing redundancy_raidz.ksh test case to
verify self-healing (as well as resilver and scrub).  Then applies
the same test case to dRAID with a slightly modified version of
the test script called redundancy_draid.ksh.  The unused variable
combrec was also removed from both test cases.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #12010

3 years agodracut/90/module-setup: mainly shellcheck cleanup
наб [Mon, 3 May 2021 20:11:02 +0000 (22:11 +0200)]
dracut/90/module-setup: mainly shellcheck cleanup

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue #11956

3 years agoReplace ZoL with OpenZFS where applicable
наб [Mon, 3 May 2021 19:21:21 +0000 (21:21 +0200)]
Replace ZoL with OpenZFS where applicable

Afterward, git grep ZoL matches:
  * README.md:  * [ZoL Site](https://zfsonlinux.org)
  - Correct
  * etc/default/zfs.in:# ZoL userland configuration.
  - Changing this would induce a needless upgrade-check,
    if the user has modified the configuration;
    this can be updated the next time the defaults change
  * module/zfs/dmu_send.c:   * ZoL < 0.7 does not handle [...]
  - Before 0.7 is ZoL, so fair enough

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue #11956

3 years agoFreeBSD: Remove !FreeBSD ifdef'd code
Ryan Moeller [Mon, 3 May 2021 17:56:08 +0000 (17:56 +0000)]
FreeBSD: Remove !FreeBSD ifdef'd code

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11994

3 years agoClean up use of zfs_log_create in zfs_dir
Ryan Moeller [Mon, 3 May 2021 17:51:03 +0000 (17:51 +0000)]
Clean up use of zfs_log_create in zfs_dir

zfs_log_create returns void, so there is no reason to cast its return
value to void at the call site.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11994

3 years agozed: protect against wait4()/fork() races to the global PID table
наб [Fri, 7 May 2021 22:10:16 +0000 (00:10 +0200)]
zed: protect against wait4()/fork() races to the global PID table

This can be very easily triggered by adding a sleep(1) before
the wait4() on a PID-starved system: the reaper thread would wait
for a child before its entry appeared, letting old entries accumulate:

  Invoking "all-debug.sh" eid=3021 pid=391
  Finished "(null)" eid=0 pid=391 time=0.002432s exit=0
  Invoking "all-syslog.sh" eid=3021 pid=336
  Finished "(null)" eid=0 pid=336 time=0.002432s exit=0
  Invoking "history_event-zfs-list-cacher.sh" eid=3021 pid=347
  Invoking "all-debug.sh" eid=3022 pid=349
  Finished "history_event-zfs-list-cacher.sh" eid=3021 pid=347
                                              time=0.001669s exit=0
  Finished "(null)" eid=0 pid=349 time=0.002404s exit=0
  Invoking "all-syslog.sh" eid=3022 pid=370
  Finished "(null)" eid=0 pid=370 time=0.002427s exit=0
  Invoking "history_event-zfs-list-cacher.sh" eid=3022 pid=391
  avl_find(tree, new_node, &where) == NULL
  ASSERT at ../../module/avl/avl.c:641:avl_add()
  Thread 1 "zed" received signal SIGABRT, Aborted.

By employing this wider lock, we atomise [wait, remove] and [fork, add]:
slowing down the reaper thread now just causes some zombies
to accumulate until it can get to them

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Don Brady <don.brady@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11963
Closes #11965

3 years agoReturn required size when encode_fh size too small
Alyssa Ross [Fri, 7 May 2021 22:08:16 +0000 (22:08 +0000)]
Return required size when encode_fh size too small

Quoting <linux/exportfs.h>:

> encode_fh() should return the fileid_type on success and on error
> returns 255 (if the space needed to encode fh is greater than
> @max_len*4 bytes). On error @max_len contains the minimum size (in 4
> byte unit) needed to encode the file handle.

ZFS was not setting max_len in the case where the handle was too
small.  As a result of this, the `t_name_to_handle_at.c' example in
name_to_handle_at(2) did not work on ZFS.

zfsctl_fid() will itself set max_len if called with a fid that is too
small, so if we give zfs_fid() that behavior as well, the fix is quite
easy: if the handle is too small, just use a zero-size fid instead of
the handle.

Tested by running t_name_to_handle_at on a normal file, a directory, a
.zfs directory, and a snapshot.

Thanks-to: Puck Meerburg <puck@puckipedia.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Alyssa Ross <hi@alyssa.is>
Closes #11995

3 years agoSimplify/fix dnode_move() for dn_zfetch
Alexander Motin [Fri, 7 May 2021 22:07:03 +0000 (18:07 -0400)]
Simplify/fix dnode_move() for dn_zfetch

Previous code tried to keep prefetch streams while moving dnode.  But
it was at least not updating per-stream zs_fetchback pointers, causing
use-after-free on next access.  Instead of that I see much easier and
cleaner to just drop old prefetch state and start new from scratch.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #11936
Closes #11998

3 years agoundocumented libzfs API changes broke "zfs list"
Matthew Ahrens [Thu, 6 May 2021 18:24:56 +0000 (11:24 -0700)]
undocumented libzfs API changes broke "zfs list"

While OpenZFS does permit breaking changes to the libzfs API, we should
avoid these changes when reasonably possible, and take steps to mitigate
the impact to consumers when changes are necessary.

Commit e4288a8397bb1f made a libzfs API change that is especially
difficult for consumers because there is no change to the function
signatures, only to their behavior.  Therefore, consumers can't notice
that there was a change at compile time.  Also, the API change was
incompletely and incorrectly documented.

The commit message mentions `zfs_get_prop()` [sic], but all callers of
`get_numeric_property()` are impacted: `zfs_prop_get()`,
`zfs_prop_get_numeric()`, and `zfs_prop_get_int()`.

`zfs_prop_get_int()` always calls `get_numeric_property(src=NULL)`, so
it assumes that the filesystem is not mounted.  This means that e.g.
`zfs_prop_get_int(ZFS_PROP_MOUNTED)` always returns 0.

The documentation says that to preserve the previous behavior, callers
should initialize `*src=ZPROP_SRC_NONE`, and some callers were changed
to do that.  However, the existing behavior is actually preserved by
initializing `*src=ZPROP_SRC_ALL`, not `NONE`.

The code comment above `zfs_prop_get()` says, "src: ... NULL will be
treated as ZPROP_SRC_ALL.".  However, the code actually treats NULL as
ZPROP_SRC_NONE.  i.e. `zfs_prop_get(src=NULL)` assumes that the
filesystem is not mounted.

There are several existing calls which use `src=NULL` which are impacted
by the API change, most noticeably those used by `zfs list`, which now
assumes that filesystems are not mounted.  For example,
`zfs list -o name,mounted` previously indicated whether a filesystem was
mounted or not, but now it always (incorrectly) indicates that the
filesystem is not mounted (`MOUNTED: no`).  Similarly, properties that
are set at mount time are ignored.  E.g. `zfs list -o name,atime` may
display an incorrect value if it was set at mount time.

To address these problems, this commit reverts commit e4288a8397bb1f:
"zfs get: don't lookup mount options when using "-s local""

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #11999

3 years agoFreeBSD: Initialize/destroy zp->z_lock
Ryan Moeller [Thu, 6 May 2021 16:45:16 +0000 (12:45 -0400)]
FreeBSD: Initialize/destroy zp->z_lock

zp->z_lock is used in shared code for protecting projid and scantime.
We don't exercise these paths much if at all on FreeBSD, so have been
lucky enough not to have issues with the uninitialized locks so far.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes #12003

3 years agoUpdated zfs_dbgmsg_enable documentation to be more accurate
Rich Ercolani [Thu, 6 May 2021 04:16:51 +0000 (00:16 -0400)]
Updated zfs_dbgmsg_enable documentation to be more accurate

Changed the default specified for zfs_dbgmsg_enable, added
clarification of interaction with zfs_flags.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #11984
Closes #11986

3 years agoMiscellaneous code cleanup
Ryan Moeller [Fri, 30 Apr 2021 23:39:07 +0000 (19:39 -0400)]
Miscellaneous code cleanup

Remove some extra whitespace.

Use pointer-typed asserts in Linux's znode cache destructor for more
info when debugging.

Simplify a couple of conversions from inode to znode when we already
have the znode.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11974

3 years agoFreeBSD: Clean up ASSERT/VERIFY use in module
Ryan Moeller [Fri, 30 Apr 2021 23:36:10 +0000 (19:36 -0400)]
FreeBSD: Clean up ASSERT/VERIFY use in module

Convert use of ASSERT() to ASSERT0(), ASSERT3U(), ASSERT3S(),
ASSERT3P(), and likewise for VERIFY().  In some cases it ended up
making more sense to change the code, such as VERIFY on nvlist
operations that I have converted to use fnvlist instead.  In one
place I changed an internal struct member from int to boolean_t to
match its use.  Some asserts that combined multiple checks with &&
in a single assert have been split to separate asserts, to make it
apparent which check fails.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11971

3 years agozed.d/zed-functions.sh: fix zed_guid_to_pool() on dash
наб [Tue, 27 Apr 2021 15:27:33 +0000 (17:27 +0200)]
zed.d/zed-functions.sh: fix zed_guid_to_pool() on dash

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11935
Closes #11954

3 years agozed.d/history_event-zfs-list-cacher.sh: no grep for snapshot detection
наб [Fri, 23 Apr 2021 20:41:47 +0000 (22:41 +0200)]
zed.d/history_event-zfs-list-cacher.sh: no grep for snapshot detection

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11935

3 years agozed.d/*-notify.sh: use mktemp instead of generating temp path manually
наб [Fri, 23 Apr 2021 20:41:19 +0000 (22:41 +0200)]
zed.d/*-notify.sh: use mktemp instead of generating temp path manually

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11935

3 years agozed.d/pool_import-led.sh: fix for current zpool scripts
наб [Fri, 23 Apr 2021 20:27:50 +0000 (22:27 +0200)]
zed.d/pool_import-led.sh: fix for current zpool scripts

Also minor clean-up with folding state_to_val() into a case,
unrolling the lesser-available seq into numbers,
ignoring vdev states we don't care about,
and documentation comments

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11934
Closes #11935

3 years agolibzutil: fix dm_get_underlying_path() return if not a DM device
наб [Thu, 29 Apr 2021 08:40:39 +0000 (10:40 +0200)]
libzutil: fix dm_get_underlying_path() return if not a DM device

For example, this would happily return "/dev/(null)" for /dev/sda1

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11935

3 years agoZTS: Fix xattr_002_neg passing too soon
Ryan Moeller [Fri, 30 Apr 2021 14:37:02 +0000 (10:37 -0400)]
ZTS: Fix xattr_002_neg passing too soon

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11970

3 years agoFreeBSD: Prune some unneeded definitions
Ryan Moeller [Fri, 30 Apr 2021 14:34:53 +0000 (10:34 -0400)]
FreeBSD: Prune some unneeded definitions

IS_XATTRDIR is never used.
v_count is only used in two places, one immediately followed by the
use of the real name, v_usecount.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes #11973

3 years agoZTS: cli_root/zfs_load-key: add separate key files
наб [Fri, 30 Apr 2021 14:31:22 +0000 (16:31 +0200)]
ZTS: cli_root/zfs_load-key: add separate key files

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue: #11956
Closes #11976

3 years agozdb: dump_history can be improved
Toomas Soome [Thu, 29 Apr 2021 23:44:07 +0000 (02:44 +0300)]
zdb: dump_history can be improved

We only recognize some history records, instead, use
same logic as in print_history_records() in zpool_main.c.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Toomas Soome <tsoome@me.com>
Closes #11940

3 years agozfs get: don't lookup mount options when using "-s local"
Alan Somers [Thu, 29 Apr 2021 21:19:44 +0000 (15:19 -0600)]
zfs get: don't lookup mount options when using "-s local"

Looking up mount options can be very expensive on servers with many
mounted file systems.  When doing "zfs get" with any "-s" option that
does not include "temporary", the mount list will never be used.  This
commit optimizes for that case.

This is a breaking commit for libzfs!  Callers of zfs_get_prop are now
required to initialize src.  To preserve existing behavior, they should
initialize it to ZPROP_SRC_NONE.

Sponsored by: Axcient
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alan Somers <asomers@gmail.com>
Closes #11955

3 years agovdev_id: variable not getting expanded under map_slot()
Arshad Hussain [Thu, 29 Apr 2021 20:58:49 +0000 (02:28 +0530)]
vdev_id: variable not getting expanded under map_slot()

Under function map_slot() variable passed as args
were not getting properly substituted or expanded.
This patch fixes the substitution issue.

Reviewed-by: Niklas Edmundsson <nikke@acc.umu.se>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Closes #11951
Closes #11959

3 years agovdev_mirror: don't scrub/resilver devices that can't be read
Nathaniel Wesley Filardo [Wed, 28 Apr 2021 00:48:11 +0000 (01:48 +0100)]
vdev_mirror: don't scrub/resilver devices that can't be read

This ensures that we don't accumulate checksum errors against offline or
unavailable devices but, more importantly, means that we don't
needlessly create DTL entries for offline devices that are already
up-to-date.

Consider a 3-way mirror, with disk A always online (and so always with
an empty DTL) and B and C only occasionally online.  When A & B resilver
with C offline, B's DTL will effectively be appended to C's due to these
spurious ZIOs even as the resilver empties B's DTL:

  * These ZIOs land in vdev_mirror_scrub_done() and flag an error

  * That flagged error causes vdev_mirror_io_done() to see
    unexpected_errors, so it issues a ZIO_TYPE_WRITE repair ZIO, which
    inherits ZIO_FLAG_SCAN_THREAD because zio_vdev_child_io() includes
    that flag in ZIO_VDEV_CHILD_FLAGS.

  * That ZIO fails, too, and eventually zio_done() gets its hands on it
    and calls vdev_stat_update().

  * vdev_stat_update() sees the error and this zio...

    * is not speculative,
    * is not due to EIO (but rather ENXIO, since the device is closed)
    * has an ->io_vd != NULL (specifically, the offline leaf device)
    * is a write
    * is for a txg != 0 (but rather the read block's physical birth txg)
    * has ZIO_FLAG_SCAN_THREAD asserted

  * So: vdev_stat_update() calls vdev_dtl_dirty() on the offline vdev.

Then, when A & C resilver with B offline, that story gets replayed and
C's DTL will be appended to B's.

In fact, one does not need this permanently-broken-mirror scenario to
induce badness: breaking a mirror with no DTLs and then scrubbing will
create DTLs for all offline devices.  These DTLs will persist until the
entire mirror is reassembled for the duration of the *resilver*, which,
incidentally, will not consider the devices with good data to be sources
of good data in the case of a read failure.

Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Nathaniel Wesley Filardo <nwfilardo@gmail.com>
Closes #11930

3 years agozfs.spec.in: remove post ldconfig scriptlets
Brian Behlendorf [Wed, 28 Apr 2021 00:45:40 +0000 (17:45 -0700)]
zfs.spec.in: remove post ldconfig scriptlets

In Fedora 28 the packaging guidelines were changed such that ldconfig
should no longer be called in either the %post or %postun scriptlets.
Instead the new compatibility macros %ldconfig_post, %ldconfig_postun,
and %ldocnfig_scriptlets should be used.

Since we only currently support Fedora 31 and newer, we could drop
%post or %postun scriptlets entirely according to the guidelines.
However, since we also use the same spec file for CentOS / RHEL
it's convenient to call the macros which are available starting
with CentOS / RHEL 8.  For CentOS / RHEL 7 we must still call
ldconfig in the traditional way.

https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11931

3 years agozdb: ASSERT issues when DEBUG is not defined
Toomas Soome [Tue, 27 Apr 2021 15:33:37 +0000 (18:33 +0300)]
zdb: ASSERT issues when DEBUG is not defined

If zdb is not built with DEBUG mode, the ASSERT macros will be
eliminated.

This will leave vim defined, but not used (gcc warning) and
checkpoint spacemap validation loop will do nothing.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Toomas Soome <tsoome@me.com>
Closes #11932

3 years agoZTS: Add known exceptions
Brian Behlendorf [Tue, 27 Apr 2021 15:27:03 +0000 (08:27 -0700)]
ZTS: Add known exceptions

Both the zpool_initialize_import_export and checkpoint_discard_busy
test cases a known to occasionally fail.  Add them to the list of
known possible failures and reference the appropriate issue on the
tracker.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11949

3 years agoDrop "All rights reserved" from files by trasz@FreeBSD.org
Martin Matuška [Tue, 27 Apr 2021 15:25:48 +0000 (17:25 +0200)]
Drop "All rights reserved" from files by trasz@FreeBSD.org

This obeys the change in freebsd/freebsd-src@bce7ee9d4

External-issue: https://reviews.freebsd.org/D26980
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Martin Matuska <mm@FreeBSD.org>
Closes #11947

3 years agoreceive: don't fail inheriting (-x) properties on wrong dataset type
Prawn [Tue, 27 Apr 2021 00:23:51 +0000 (02:23 +0200)]
receive: don't fail inheriting (-x) properties on wrong dataset type

Receiving datasets while blanket inheriting properties like zfs
receive -x mountpoint can generally be desirable, e.g. to avoid
unexpected mounts on backup hosts.

Currently this will fail to receive zvols due to the mountpoint
property being applicable to filesystems only.  This limitation
currently requires operators to special-case their minds and tools
for zvols.

This change gets rid of this limitation for inherit (-x) by
Spiting up the dataset type handling: Warnings for inheriting (-x),
errors for overriding (-o).

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
Closes #11416
Closes #11840
Closes #11864

3 years agoFreeBSD: damage control racing .. lookups in face of mkdir/rmdir
Mateusz Guzik [Mon, 26 Apr 2021 19:44:40 +0000 (21:44 +0200)]
FreeBSD: damage control racing .. lookups in face of mkdir/rmdir

External-issue: https://reviews.freebsd.org/D29769
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #11926

3 years agoFix AVX512BW Fletcher code on AVX512-but-not-BW machines
Romain Dolbeau [Mon, 26 Apr 2021 19:42:42 +0000 (21:42 +0200)]
Fix AVX512BW Fletcher code on AVX512-but-not-BW machines

Introduce a specific valid function for avx512f+avx512bw (instead
of checking only for avx512f).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Adam Moss <c@yotes.com>
Signed-off-by: Romain Dolbeau <romain@dolbeau.org>
Closes #11937
Closes #11938

3 years agozed: protect against wait4()/fork() races to the launched process tree
наб [Fri, 23 Apr 2021 00:49:21 +0000 (02:49 +0200)]
zed: protect against wait4()/fork() races to the launched process tree

As soon as wait4() returns, fork() can immediately return with the same
PID, and race to lock _launched_processes_lock, then try to add the new
(duplicate) PID to _launched_processes, which asserts

By locking before wait4(), we ensure, that, given that same
unfortunate scheduling, _launched_processes_lock cannot be locked by the
spawner before we pop the process in the reaper, and only afterward will
it be added

This moves where the reaper idles when there are children from the
wait4() to the pause(), locking for the duration of that single syscall
in both the no-children and running-children cases; the impact of this
is one to two syscalls (depending on _launched_processes_lock state)
per loop

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Don Brady <don.brady@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11924
Closes #11928

3 years agoFixed incorrect man page reference in zfsprops(8)
Daniel Stevenson [Tue, 20 Apr 2021 17:16:00 +0000 (12:16 -0500)]
Fixed incorrect man page reference in zfsprops(8)

The special_small_blocks section directed readers to zpool(8) for
documentation on special allocation classes, while they are actually
documented in zpoolconcepts(8).

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Daniel Stevenson <daniel@dstev.net>
Closes #11918

3 years agoetc/systemd/zfs-mount-generator: don't fail if no cached pools
наб [Mon, 19 Apr 2021 17:52:44 +0000 (19:52 +0200)]
etc/systemd/zfs-mount-generator: don't fail if no cached pools

If $FSLIST exists but is empty, the generator fails with
  sort: cannot read: '/etc/zfs/zfs-list.cache/*':
  No such file or directory

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11915

3 years agolibshare: nfs: commonify nfs_enable_share()
наб [Thu, 15 Apr 2021 22:40:22 +0000 (00:40 +0200)]
libshare: nfs: commonify nfs_enable_share()

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <gwilson@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11886

3 years agofreebsd/libshare: nfs: make nfs_is_shared() thread-safe
наб [Sun, 11 Apr 2021 18:12:50 +0000 (20:12 +0200)]
freebsd/libshare: nfs: make nfs_is_shared() thread-safe

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <gwilson@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11886

3 years agolibshare: nfs: commonify nfs_{init,fini}_tmpfile(), nfs_disable_share()
наб [Sun, 11 Apr 2021 17:42:07 +0000 (19:42 +0200)]
libshare: nfs: commonify nfs_{init,fini}_tmpfile(), nfs_disable_share()

Also open the temp file cloexec

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <gwilson@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11886

3 years agolibshare: nfs: commonify nfs_exports_[un]lock(), FILE_HEADER
наб [Sun, 11 Apr 2021 17:37:48 +0000 (19:37 +0200)]
libshare: nfs: commonify nfs_exports_[un]lock(), FILE_HEADER

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <gwilson@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11886

3 years agolibshare: nfs: don't leak nfs_lock_fd when lock fails
наб [Sun, 11 Apr 2021 17:27:43 +0000 (19:27 +0200)]
libshare: nfs: don't leak nfs_lock_fd when lock fails

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <gwilson@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11886

3 years agolibspl: implement atomics in terms of atomics
наб [Mon, 19 Apr 2021 05:13:24 +0000 (07:13 +0200)]
libspl: implement atomics in terms of atomics

This replaces the generic libspl atomic.c atomics implementation
with one based on builtin gcc atomics.  This functionality was added
as an experimental feature in gcc 4.4.  Today even CentOS 7 ships
with gcc 4.8 as the default compiler we can make this the default.

Furthermore, the builtin atomics are as good or better than our
hand-rolled implementation so it's reasonable to drop that custom code.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11904

3 years agoZTS: Improve redundancy test scripts
Brian Behlendorf [Mon, 19 Apr 2021 04:58:36 +0000 (21:58 -0700)]
ZTS: Improve redundancy test scripts

- Add additional logging to provide more information about why the
  test failed.  This including logging more of the individual commands
  and the contents and differences of the record files on failure.

- Updated get_vdevs() to properly exclude all top-level vdevs
  including raidz3 and draid[1-3].

- Replaced gnudd with dd.  This is the only remaining place in the
  test suite gnudd is used and it shouldn't be needed.

- The refill_test_env function expects the pool as the first argument
  but never sets the pool variable.

- Only fill the test pools to 50% of capacity instead of 75% to help
  speed up the tests.

- Fix replace_missing_devs() calculation, MINDEVSIZE should be
  MINVDEVSIZE.

- Fix damage_devs() so it overwrites almost all of the device so
  we're guaranteed to damage filesystem blocks.

- redundancy_stripe.ksh should not use log_mustnot to check if the
  pool is healthy since the return value may be misinterpreted.
  Just perform a normal conditional check and log the failure.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11906

3 years agoICP: Silence objtool "stack pointer realignment" warnings
Attila Fülöp [Sat, 17 Apr 2021 20:11:18 +0000 (22:11 +0200)]
ICP: Silence objtool "stack pointer realignment" warnings

Objtool requires the use of a DRAP register while aligning the
stack. Since a DRAP register is a gcc concept and we are
notoriously low on registers in the crypto code, it's not worth
the effort to mimic gcc generated stack realignment.

We simply silence the warning by adding the offending object files
to OBJECT_FILES_NON_STANDARD.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #6950
Closes #11914

3 years agolibzfs: refresh property cache after inheriting userprop
наб [Fri, 16 Apr 2021 18:03:20 +0000 (20:03 +0200)]
libzfs: refresh property cache after inheriting userprop

This matches what happens when inheriting a system property

Consider the following program:
int main() {
void *zhp = libzfs_init();
void *dataset = zfs_open(zhp, "zest/__test", 1);

printf("before:");
dump_nvlist(zfs_get_user_props(dataset), 2);
printf("\n");

zfs_prop_inherit(dataset, "xyz.nabijaczleweli:test", 0);
printf("after:");
dump_nvlist(zfs_get_user_props(dataset), 2);
printf("\n");

zfs_refresh_properties(dataset);
printf("refreshed:");
dump_nvlist(zfs_get_user_props(dataset), 2);
printf("\n");
}

And the output before:
# zfs set xyz.nabijaczleweli:test=hehe zest/__test
# ./a.out
before:  xyz.nabijaczleweli:test:
      value: 'hehe'
      source: 'zest/__test'

after:  xyz.nabijaczleweli:test:
      value: 'hehe'
      source: 'zest/__test'

refreshed:

As compared to the output after:
# zfs set xyz.nabijaczleweli:test=hehe zest/__test
# ./a.out
before:  xyz.nabijaczleweli:test:
      value: 'hehe'
      source: 'zest/__test'

after:
refreshed:

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11064
Closes #11911

3 years agolibzfs: don't mark prompt+raw as retriable
наб [Fri, 16 Apr 2021 15:52:47 +0000 (17:52 +0200)]
libzfs: don't mark prompt+raw as retriable

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11911
Closes #11031

3 years agoCombine zio caches if possible
Mateusz Guzik [Sat, 17 Apr 2021 19:36:04 +0000 (21:36 +0200)]
Combine zio caches if possible

This deduplicates 2 sets of caches which use the same allocation size.

Memory savings fluctuate a lot, one sample result is FreeBSD running
"make buildworld" saving ~180MB RAM in reduced page count associated
with zio caches.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #11877

3 years agocontrib/dracut: 90: zfs-{rollback,snapshot}-bootfs: use @sbindir@
наб [Wed, 14 Apr 2021 15:30:59 +0000 (17:30 +0200)]
contrib/dracut: 90: zfs-{rollback,snapshot}-bootfs: use @sbindir@

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11898

3 years agocontrib/i-t: properly mount root's children with spaces
наб [Tue, 13 Apr 2021 21:23:15 +0000 (23:23 +0200)]
contrib/i-t: properly mount root's children with spaces

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11898

3 years agocontrib/dracut: 90: mount essential datasets under root
наб [Tue, 13 Apr 2021 20:41:10 +0000 (22:41 +0200)]
contrib/dracut: 90: mount essential datasets under root

This partly mirrors what the i-t script does (though that mounts all
children, recursively) ‒ /etc, /usr, /lib*, and /bin are all essential,
if present, to successfully invoke the real init, which will then mount
everything else it might need in the right order

The following extreme-case set-up boots w/o issues now:
  /               zoot            zfs  rw,relatime,xattr,noacl
  ├─/etc          zoot/etc        zfs  rw,relatime,xattr,noacl
  ├─/usr          zoot/usr        zfs  rw,relatime,xattr,noacl
  │ └─/usr/local  zoot/usr/local  zfs  rw,relatime,xattr,noacl
  ├─/var          zoot/var        zfs  rw,relatime,xattr,noacl
  │ ├─/var/lib    zoot/var/lib    zfs  rw,relatime,xattr,noacl
  │ ├─/var/log    zoot/var/log    zfs  rw,relatime,xattr,posixacl
  │ ├─/var/cache  zoot/var/cache  zfs  rw,relatime,xattr,noacl
  │ └─/var/tmp    zoot/var/tmp    zfs  rw,relatime,xattr,noacl
  ├─/home         zoot/home       zfs  rw,relatime,xattr,noacl
  │ └─/home/nab   zoot/home/nab   zfs  rw,relatime,xattr,noacl
  ├─/boot         zoot/boot       zfs  rw,relatime,xattr,noacl
  ├─/root         zoot/home/root  zfs  rw,relatime,xattr,noacl
  ├─/opt          zoot/opt        zfs  rw,relatime,xattr,noacl
  └─/srv          zoot/srv        zfs  rw,relatime,xattr,noacl

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11898

3 years agocontrib/dracut: 90: generator: only log to kmsg if debug set on cmdline
наб [Tue, 13 Apr 2021 20:37:59 +0000 (22:37 +0200)]
contrib/dracut: 90: generator: only log to kmsg if debug set on cmdline

"debug" is also used by systemd itself, and there's really no reason for
the generator to write this much garbage by default

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11898

3 years agocontrib/dracut: 02: don't spill device names across multiple lines
наб [Tue, 13 Apr 2021 20:31:26 +0000 (22:31 +0200)]
contrib/dracut: 02: don't spill device names across multiple lines

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11898

3 years agoICP: Add missing stack frame info to SHA asm files
Attila Fülöp [Fri, 16 Apr 2021 22:11:26 +0000 (00:11 +0200)]
ICP: Add missing stack frame info to SHA asm files

Since the assembly routines calculating SHA checksums don't use
a standard stack layout, CFI directives are needed to unroll the
stack.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Attila Fülöp <attila@fueloep.org>
Closes #11733

3 years agoFix crash in zio_done error reporting
Paul Zuchowski [Fri, 16 Apr 2021 18:00:53 +0000 (14:00 -0400)]
Fix crash in zio_done error reporting

Fix NULL pointer dereference when reporting
checksum error for gang block in zio_done.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
Closes #11872
Closes #11896

3 years agozfs-send(8): Restore sorting of flags
Ryan Moeller [Fri, 16 Apr 2021 00:43:07 +0000 (20:43 -0400)]
zfs-send(8): Restore sorting of flags

Before #11710 the flags in zfs-send(8) were sorted.
Restore order and bump the date.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11905

3 years agolinux/spl: proc: use global table_{min,max} values instead of local ones
наб [Sun, 11 Apr 2021 14:29:00 +0000 (16:29 +0200)]
linux/spl: proc: use global table_{min,max} values instead of local ones

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11879

3 years agolinux/libspl: gethostid: read from /proc/sys/kernel/spl/hostid, simplify
наб [Sat, 10 Apr 2021 23:51:04 +0000 (01:51 +0200)]
linux/libspl: gethostid: read from /proc/sys/kernel/spl/hostid, simplify

Fixes get_system_hostid() if it was set via the aforementioned sysctl
and simplifies the code a bit.  The kernel and user-space must agree,
after all.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11879

3 years agolinux/spl: base proc_dohostid() on proc_dostring()
наб [Sat, 10 Apr 2021 23:18:40 +0000 (01:18 +0200)]
linux/spl: base proc_dohostid() on proc_dostring()

This fixes /proc/sys/kernel/spl/hostid on kernels with mainline commit
32927393dc1ccd60fb2bdc05b9e8e88753761469 ("sysctl: pass kernel pointers
to ->proc_handler") ‒ 5.7-rc1 and up

The access_ok() check in copy_to_user() in proc_copyout_string() would
always fail, so all userspace reads and writes would fail with EINVAL

proc_dostring() strips only the final new-line,
but simple_strtoul() doesn't actually need a back-trimmed string ‒
writing "012345678   \n" is still allowed, as is "012345678zupsko", &c.

This alters what happens when an invalid value is written ‒
previously it'd get set to what-ever simple_strtoul() returned
(probably 0, thereby resetting it to default), now it does nothing

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11878
Closes #11879

3 years agolibspl: lift common bits of getexecname()
наб [Sat, 10 Apr 2021 01:28:53 +0000 (03:28 +0200)]
libspl: lift common bits of getexecname()

Merge the actual implementations of getexecname() and slightly clean
up the FreeBSD one.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11879

3 years agomodule/zfs/zvol.c: purge unused zvol_volmode_cb_arg
наб [Sat, 10 Apr 2021 01:27:26 +0000 (03:27 +0200)]
module/zfs/zvol.c: purge unused zvol_volmode_cb_arg

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11879

3 years agoZFS traverse_visitbp optimization to limit prefetch
Jitendra Patidar [Thu, 15 Apr 2021 20:49:27 +0000 (02:19 +0530)]
ZFS traverse_visitbp optimization to limit prefetch

Traversal code, traverse_visitbp() does visit blocks recursively.
Indirect (Non L0) Block of size 128k could contain, 1024 block pointers
of 128 bytes. In case of full traverse OR incremental traverse, where
all blocks were modified, it could traverse large number of blocks
pointed by indirect. Traversal code does issue prefetch of blocks
traversed below indirect. This could result into large number of
async reads queued on vdev queue. So, account for prefetch issued for
blocks pointed by indirect and limit max prefetch in one go.

Module Param:
zfs_traverse_indirect_prefetch_limit: Limit of prefetch while traversing
an indirect block.

Local counters:
prefetched: Local counter to account for number prefetch done.
pidx: Index for which next prefetch to be issued.
ptidx: Index at which next prefetch to be triggered.

Keep "ptidx" somewhere in the middle of blocks prefetched, so that
blocks prefetch read gets the enough time window before their demand
read is issued.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Jitendra Patidar <jitendra.patidar@nutanix.com>
Closes #11802
Closes #11803

3 years agoZTS: add zed_fd_spill to verify the fds ZEDLETs inherit
наб [Mon, 12 Apr 2021 12:08:33 +0000 (14:08 +0200)]
ZTS: add zed_fd_spill to verify the fds ZEDLETs inherit

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11891

3 years agozed: set O_CLOEXEC on persistent fds, remove closefrom() from pre-exec
наб [Mon, 12 Apr 2021 12:07:14 +0000 (14:07 +0200)]
zed: set O_CLOEXEC on persistent fds, remove closefrom() from pre-exec

Also don't dup /dev/null over stdio if daemonised

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11891

3 years agoAdd SIGSTOP and SIGTSTP handling to issig
Paul Dagnelie [Thu, 15 Apr 2021 20:34:35 +0000 (13:34 -0700)]
Add SIGSTOP and SIGTSTP handling to issig

This change adds SIGSTOP and SIGTSTP handling to the issig function;
this mirrors its behavior on Solaris. This way, long running kernel
tasks can be stopped with the appropriate signals. Note that doing
so with ctrl-z on the command line doesn't return control of the tty
to the shell, because tty handling is done separately from stopping
the process. That can be future work, if people feel that it is a
necessary addition.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Paul Dagnelie <pcd@delphix.com>
Issue #810
Issue #10843
Closes #11801

3 years agoFix 'make checkbashisms` warnings
Brian Behlendorf [Thu, 15 Apr 2021 15:53:08 +0000 (08:53 -0700)]
Fix 'make checkbashisms` warnings

The awk command used by the checkbashisms target incorrectly
adds the escape character before the ! and # characters.  This
results in the following warnings because these characters do not
need to be escaped.

    awk: cmd. line:1: warning: regexp escape sequence
        `\!' is not a known regexp operator
    awk: cmd. line:1: warning: regexp escape sequence
        `\#' is not a known regexp operator

Remove the unneeded escape character before ! and #.

Valid escape sequences are:

    https://www.gnu.org/software/gawk/manual/html_node/Escape-Sequences.html

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11902

3 years agoFix vdev health padding in zpool list -v
Yuri Pankov [Wed, 14 Apr 2021 16:02:16 +0000 (19:02 +0300)]
Fix vdev health padding in zpool list -v

Do not (incorrectly, right instead left) pad health string itself,
it will be taken care of when printing property value below.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Yuri Pankov <yuripv@FreeBSD.org>
Closes #11899

3 years agoObsolete earlier packages due to version bump
Brian Behlendorf [Tue, 13 Apr 2021 23:33:06 +0000 (16:33 -0700)]
Obsolete earlier packages due to version bump

Follow up to d5ef91af which adds a missing 'obsoletes' for the
libzfs-devel package.

Add a comment to the zfs.spec file as a reminder that previous
versions of the package should be marked as obsolete.

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11844
Closes #11895

3 years agolibzfs: get rid of unused libzfs_handle::libzfs_{storeerr,chassis_id}
наб [Tue, 13 Apr 2021 11:00:35 +0000 (13:00 +0200)]
libzfs: get rid of unused libzfs_handle::libzfs_{storeerr,chassis_id}

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11868

3 years agolibzfs: get rid of libzfs_handle::libzfs_mnttab
наб [Thu, 8 Apr 2021 22:44:23 +0000 (00:44 +0200)]
libzfs: get rid of libzfs_handle::libzfs_mnttab

All users did a freopen() on it. Even some non-users did!
This is point-less ‒ just open the mtab when needed

If I understand Solaris' getextmntent(3C) correctly, the non-user
freopen()s are very likely an odd, twisted vestigial tail of that ‒
but it's got a completely different calling convention and caching
semantics than any platform we support

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11868

3 years agolinux/libspl: getextmntent(): don't leak mnttab FILE*
наб [Thu, 8 Apr 2021 22:42:03 +0000 (00:42 +0200)]
linux/libspl: getextmntent(): don't leak mnttab FILE*

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11868

3 years agolibzfs: zfs_mount_at(): load key for encryption root if MS_CRYPT
наб [Tue, 13 Apr 2021 04:26:55 +0000 (06:26 +0200)]
libzfs: zfs_mount_at(): load key for encryption root if MS_CRYPT

zfs_crypto_load_key() only works on encryption roots,
and zfs mount -la would fail if it encounters a datasets that
is sorted before their encroots.

To trigger:
  truncate -s 40G /tmp/test
  dd if=/dev/urandom of=/tmp/k bs=128 count=1 status=none
  zpool create -O encryption=on -O keylocation=file:///tmp/k \
               -O keyformat=passphrase test /tmp/test
  zfs create -o mountpoint=/a test/a
  zfs create -o mountpoint=/b test/b
  zfs umount test
  zfs unload-key test
  zfs mount -la

The final mount errored out with:
  Key load error: Keys must be loaded for
    encryption root of 'test/a' (test).
  Key load error: Keys must be loaded for
    encryption root of 'test/b' (test).

And only /test was mounted

This technically breaks the libzfs API, but the previous behavior was
decidedly a bug.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11870
Closes #11875

3 years agoFreeBSD: use vnlru_free_vfsops if available
Mateusz Guzik [Mon, 12 Apr 2021 18:01:46 +0000 (20:01 +0200)]
FreeBSD: use vnlru_free_vfsops if available

Fixes issues when zfs is used along with other filesystems.

External-issue: https://cgit.freebsd.org/src/commit/?id=e9272225e6bed840b00eef1c817b188c172338ee
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #11881

3 years agoFreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr
Mateusz Guzik [Mon, 12 Apr 2021 17:59:57 +0000 (19:59 +0200)]
FreeBSD: add missing seqc write begin/end around zfs_acl_chown_setattr

It happens to trip over an assert but does not matter for correctness at
this time. Done for future proofing.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #11884

3 years agoFreeBSD: add support for lockless symlink lookup
Mateusz Guzik [Mon, 12 Apr 2021 17:59:22 +0000 (19:59 +0200)]
FreeBSD: add support for lockless symlink lookup

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Closes #11883

3 years ago.gitmodules: link to openzfs github repository
наб [Fri, 9 Apr 2021 01:26:45 +0000 (03:26 +0200)]
.gitmodules: link to openzfs github repository

Update the test images link to reference the openzfs github repository.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Issue #11868

3 years agocmd/zfs receive: allow dry-run (-n) to check property args
Prawn [Mon, 12 Apr 2021 16:35:55 +0000 (18:35 +0200)]
cmd/zfs receive: allow dry-run (-n) to check property args

zfs recv -n does not report some errors it could.  The code to bail
out of the receive if in dry-run mode came a little early, skipping
validation of cmdprops (recv -x and -o) among others.  Move the
check down to enable these additional checks.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
Closes #11862

3 years agolibuutil: purge unused functions
наб [Mon, 12 Apr 2021 16:32:43 +0000 (18:32 +0200)]
libuutil: purge unused functions

Remove vestigial uu_open_tmp().  The problems with this implementation
are many, but the primary one is the TMPPATHFMT macro, which is
unused, and always has been.

Searching around for any users leads only to earlier imports of the
same, identical file, i.a. into an apple repository (which does patch
gethrtime() into it and gives us a copyright date of 2007),
and a MidnightBSD one from 2008.

Searching illumos-gate, uu_open_tmp appears, in current HEAD, three
times: in the header, libuutil's mapfile ABI, and the implementation.

This slowly grows up to eight occurrences as one moves back to the root
"OpenSolaris Launch" commit: the header, implementation, twice in
libuutil's spec ABI, twice (with multilib and non-multilib paths) in
libuutil.so's i386 and SPARC binary db ABIs.

That's 2005, and this file was abandonware even then, it's dead code.

The situation is similar for the uu_dprintf() family of functions and
uu_dump().  Nothing in accessibly recorded history has ever used them.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11873

3 years agoImprovements to the 'compatibility' property
Colm [Mon, 12 Apr 2021 16:08:56 +0000 (17:08 +0100)]
Improvements to the 'compatibility' property

Several improvements to the operation of the 'compatibility' property:

1) Improved handling of unrecognized features:
Change the way unrecognized features in compatibility files are handled.

 * invalid features in files under /usr/share/zfs/compatibility.d
   only get a warning (as these may refer to future features not yet in
   the library),
 * invalid features in files under /etc/zfs/compatibility.d
   get an error (as these are presumed to refer to the current system).

2) Improved error reporting from zpool_load_compat.
Note: slight ABI change to zpool_load_compat for better error reporting.

3) compatibility=legacy inhibits all 'zpool upgrade' operations.

4) Detect when features are enabled outside current compatibility set
   * zpool set compatibility=foo <-- print a warning
   * zpool set feature@xxx=enabled <-- error
   * zpool status <-- indicate this state

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Colm Buckley <colm@tuatha.org>
Closes #11861

3 years agoZTS: fix removal_condense_export test case
Brian Behlendorf [Mon, 12 Apr 2021 04:49:13 +0000 (21:49 -0700)]
ZTS: fix removal_condense_export test case

It's been observed in the CI that the required 25% of obsolete bytes
in the mapping can be to high a threshold for this test resulting in
condensing never being triggered and a test failure.  To prevent these
failures make the existing zfs_condense_indirect_obsolete_pct tuning
available so the obsolete percentage can be reduced from 25% to 5%
during this test.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11869

3 years agoUpdate libzfs.abi for zfs_send() change
Brian Behlendorf [Mon, 12 Apr 2021 00:03:55 +0000 (17:03 -0700)]
Update libzfs.abi for zfs_send() change

Commit 099fa7e4 intentionally modified the libzfs ABI.  However, it
failed to include an update for the libzfs.abi file.  This commit
resolves the `make checkabi` warning due to that omission.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11710