ZFS on Linux/src 9dc41a7lib/libzfs libzfs_diff.c

Fix wrong assertion in libzfs diff error handling

In compare(), all error cases set the error code to EPIPE, so when an
error is set, the correct assertion to make is that the error is EPIPE,
not EINVAL.

Reviewed-by: Richard Elling <Richard.Elling at RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Ryan Moeller <ryan at freqlabs.com>
Closes #8743 

ZFS on Linux/src e61b534module/zfs dnode.c

Fix incorrect assertion in dnode_dirty_l1range

The db_dirtycnt of an EVICTING dbuf is always 0. However, it still 
appears in the dn_dbufs tree. If we call dnode_dirty_l1range on a 
range that contains an EVICTING dbuf, we will attempt to mark it dirty 
(which will fail because it's EVICTING, resulting in a new dbuf being 
created and dirtied). Later, in ZFS_DEBUG mode, we assert that all the 
dbufs in the range are dirty. If the EVICTING dbuf is still present, 
this will trip the assertion erroneously.

Reviewed-by: Matt Ahrens <mahrens at delphix.com>
Reviewed-by: Richard Elling <Richard.Elling at RichardElling.com>
Reviewed-by: Sara Hartse <sara.hartse at delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Paul Dagnelie <pcd at delphix.com>
Closes #8745 
DeltaFile
+2-1module/zfs/dnode.c
+2-11 files

ZFS on Linux/src 78c785bcmd/zdb zdb.c, module/zfs spa.c dsl_deadlist.c

Fast Clone Deletion

Deleting a clone requires finding blocks are clone-only, not shared
with the snapshot. This was done by traversing the entire block tree
which results in a large performance penalty for sparsely
written clones.

This is new method keeps track of clone blocks when they are
modified in a "Livelist" so that, when it’s time to delete,
the clone-specific blocks are already at hand.

We see performance improvements because now deletion work is
proportional to the number of clone-modified blocks, not the size
of the original dataset.

Signed-off-by: sara hartse <sara.hartse at delphix.com>

ZFS on Linux/src fae035dinclude/sys zthr.h, man/man5 zfs-module-parameters.5

review comments

ZFS on Linux/src f378f42. META

Tag 0.8.0-rc5

Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
DeltaFile
+2-2META
+2-21 files

ZFS on Linux/src ca95f70include/sys spa.h, module/zfs spa_misc.c spa.c

zpool import progress kstat

When an import requires a long MMP activity check, or when the user
requests pool recovery, the import make take a long time.  The user may
not know why, or be able to tell whether the import is progressing or is
hung.

Add a kstat which lists all imports currently being processed by the
kernel (currently only one at a time is possible, but the kstat allows
for more than one).  The kstat is /proc/spl/kstat/zfs/import_progress.

The kstat contents are as follows:
pool_guid         load_state multihost_secs  max_txg pool_name
16667015954387398 3          15              0       tank3

load_state: the value of spa_load_state
multihost_secs:  seconds until the end of the multihost activity
                 check; if over, or none required, this is 0
max_txg: current spa_load_max_txg, if rewind is occurring

This could be used by outside tools, such as a pacemaker resource agent,
to report import progress, or as a part of manual troubleshooting.  The
zpool import subcommand could also be modified to report this
information.


    [3 lines not shown]

ZFS on Linux/src b689de8module/spl spl-generic.c, module/zfs zfs_vfsops.c

Add missing trailing '\n' in printk() messages

These messages will want '\n' like any other regular printk() messages.

Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Richard Laager <rlaager at wiktel.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at osnexus.com>
Closes #8726 

ZFS on Linux/src 4bb40c1cmd/zfs zfs_iter.c

Fix dataset name comparison in zfs_compare()

The code never returned match comparing two datasets (not snapshots).
As result, uu_avl_find(), called from zfs_callback(), never succeeded,
allowing to add same dataset into the list multiple times, for example:

        # zfs get name pers pers pers at z pers at z
        NAME    PROPERTY  VALUE   SOURCE
        pers    name      pers    -
        pers    name      pers    -
        pers at z  name      pers at z  -

With the patch:

        # zfs get name pers pers pers at z pers at z
        NAME    PROPERTY  VALUE   SOURCE
        pers    name      pers    -
        pers at z  name      pers at z  -

Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Igor Kozhukhov <igor at dilos.org>
Signed-off-by: Alexander Motin <mav at FreeBSD.org>
Closes #8723 
DeltaFile
+1-1cmd/zfs/zfs_iter.c
+1-11 files

ZFS on Linux/src 97aa3bamodule/zfs zfs_vnops.c

Fix link count of root inode when snapdir is visible

Given how zfs_getattr() is implemented, zfs_getattr_fast() (used by
->getattr() of zpl inodes) also needs to consider an additional link
count if "snapdir" property is set to "visible".

Without this, # of directories in root inode of each dataset doesn't
match the link count when snapdir is visible.

Reviewed-by: Richard Yao <ryao at gentoo.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at osnexus.com>
Closes #8727 

ZFS on Linux/src e2dddb7cmd/zpool zpool_main.c

Fix typesetting of Errata #4

Reviewed-by: Olaf Faaland <faaland1 at llnl.gov>
Reviewed-by: Richard Laager <rlaager at wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Justin Scholz <git at justinscholz.de>
Closes #8712 
Closes #8721 
DeltaFile
+22-23cmd/zpool/zpool_main.c
+22-231 files

ZFS on Linux/src 3b77084scripts Makefile.am

Add zol2zfs-patch.sed to Makefile.am and sort

In adding man-dates.sh, I noticed that zol2zfs-patch.sed was missing,
even though zfs2zol-patch.sed was present.  Also, the list was not
sorted, so I sorted it.

Reviewed-by: Olaf Faaland <faaland1 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8710

ZFS on Linux/src e7ce975man/man8 zgenhostid.8 zfs.8, scripts man-dates.sh

Correct man page dates

Various changes (many by me) have been made to the man pages without
bumping their dates.  I have now corrected them based on the last commit
to each file.  I also added the script I used to make these changes.

Reviewed-by: Olaf Faaland <faaland1 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8710

ZFS on Linux/src a20f43bmodule/zfs vdev_raidz_math_aarch64_neon_common.h vdev_raidz_math_ssse3.c

Linux 5.0 compat: ASM_BUG macro

The 5.0 kernel defines the macro ASM_BUG.  In order to prevent a
conflict and build failure rename ASM_BUG to ZFS_ASM_BUG.  This
is currently only an issue on aarch64 but all instances of
ASM_BUG we're renamed to avoid any future conflict on x86_64.

Reviewed-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Reviewed-by: Richard Laager <rlaager at wiktel.com>
Reviewed-by: Chris Dunlop <chris at onthe.net.au>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #8725 
Issue #8545

ZFS on Linux/src 515ddf6module/zfs zpl_file.c zvol.c

Fix errant EFAULT during writes (#8719)

Commit 98bb45e resolved a deadlock which could occur when
handling a page fault in zfs_write().  This change added
the uio_fault_disable field to the uio structure but failed
to initialize it to B_FALSE.  This uninitialized field would
cause uiomove_iov() to call __copy_from_user_inatomic()
instead of copy_from_user() resulting in unexpected EFAULTs.

Resolve the issue by fully initializing the uio, and clearing
the uio_fault_disable flags after it's used in zfs_write().

Additionally, reorder the uio_t field assignments to match
the order the fields are declared in the  structure.

Reviewed-by: Chunwei Chen <tuxoko at gmail.com>
Reviewed-by: Richard Laager <rlaager at wiktel.com>
Reviewed-by: Tim Chase <tim at chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #8640 
Closes #8719 

ZFS on Linux/src 1f02eccman/man5 zfs-module-parameters.5, module/zfs spa_misc.c

Make zfs_special_class_metadata_reserve_pct into a parameter

Exported and documented a new module parameter.

Reviewed-by: Richard Laager <rlaager at wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: DHE <git at dehacked.net>
Closes #8706 

ZFS on Linux/src caf9dd2include/sys zfs_ioctl.h, module/zfs dmu_recv.c dmu_send.c

Fix send/recv lost spill block

When receiving a DRR_OBJECT record the receive_object() function
needs to determine how to handle a spill block associated with the
object.  It may need to be removed or kept depending on how the
object was modified at the source.

This determination is currently accomplished using a heuristic which
takes in to account the DRR_OBJECT record and the existing object
properties.  This is a problem because there isn't quite enough
information available to do the right thing under all circumstances.
For example, when only the block size changes the spill block is
removed when it should be kept.

What's needed to resolve this is an additional flag in the DRR_OBJECT
which indicates if the object being received references a spill block.
The DRR_OBJECT_SPILL flag was added for this purpose.  When set then
the object references a spill block and it must be kept.  Either
it is update to date, or it will be replaced by a subsequent DRR_SPILL
record.  Conversely, if the object being received doesn't reference
a spill block then any existing spill block should always be removed.

Since previous versions of ZFS do not understand this new flag
additional DRR_SPILL records will be inserted in to the stream.
This has the advantage of being fully backward compatible.  Existing

    [18 lines not shown]

ZFS on Linux/src 9c53e51module/zfs zfs_znode.c, tests/zfs-tests/include libtest.shlib

Fix `zfs set atime|relatime=off|on` behavior on inherited datasets

`zfs set atime|relatime=off|on` doesn't disable or enable the property
on read for datasets whose property was inherited from parent, until
a dataset is once unmounted and mounted again.

(The properties start to work properly if a dataset is once unmounted
and mounted again. The difference comes from regular mount process,
e.g. via zpool import, uses mount options based on properties read
from ondisk layout for each dataset, whereas
`zfs set atime|relatime=off|on` just remounts a specified dataset.)

--
 # zpool create p1 <device>
 # zfs create p1/f1
 # zfs set atime=off p1
 # echo test > /p1/f1/test
 # sync
 # zfs list
 NAME    USED  AVAIL     REFER  MOUNTPOINT
 p1      176K  18.9G     25.5K  /p1
 p1/f1    26K  18.9G       26K  /p1/f1
 # zfs get atime
 NAME   PROPERTY  VALUE  SOURCE
 p1     atime     off    local

    [34 lines not shown]

ZFS on Linux/src 7534693include/spl/sys types.h

Linux 5.1 compat: Drop ULLONG_MAX and LLONG_MAX definitions

Linux kernel commit 54d50897d544c874562253e2a8f70dfcad22afe8
"linux/kernel.h: split *_MAX and *_MIN macros into <linux/limits.h>"

which first appeared in 5.1 has moved several macros from
<linux/kernel.h> to <linux/limits.h>. This broke compilation due to
header inclusion order against the local header include/spl/sys/types.h
which also defines ULLONG_MAX and LLONG_MAX if undefined.

It looks like local ULLONG_MAX and LLONG_MAX were never needed
(or after spl integration ?) as <linux/kernel.h> has had the same
definitions since an upstream commit
111ebb6e6f7bd7de6d722c5848e95621f43700d9 in 2.6.18, so drop them.

--
linux/include/linux/limits.h:17: error: "LLONG_MAX" redefined [-Werror]
 #define LLONG_MAX ((long long)(~0ULL >> 1))
zfs/include/spl/sys/types.h:35: note: this is the location of the previous definition
 #define LLONG_MAX  ((long long)(~0ULL>>1))

Reviewed-by: Richard Laager <rlaager at wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8714 

ZFS on Linux/src c6eaa14man/man8 zpool.8

Cleanup special/dedup language

This standardizes the language on "deduplication tables" rather than
"dedup data" (which might be read as the data blocks rather than the
DDT).  Likewise, it standardizes on "small file blocks".  It also
standardizes on "normal" rather than using both "normal" and "general"
in the same paragraph. I also replaced "non-specified" with the more
explicit "non-dedup/special".

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8713 
DeltaFile
+6-6man/man8/zpool.8
+6-61 files

ZFS on Linux/src 6aff30aetc/systemd/system-generators zfs-mount-generator.in

Fix zfs-mount-generator for datasets with spaces

Alternative implementation of @rlaager's original modification
of zfs-mount-generator fix, with @chrisrd's comments. Set
IFS to be only the tab character, matching our `-H` call in
`zfs list`, allowing spaces to appear in dataset names (and
mountpoints).

Also adds comments explaining our rationale.

Reviewed-by: Chris Dunlop <chris at onthe.net.au>
Reviewed-by: Richard Laager <rlaager at wiktel.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Antonio Russo <antonio.e.russo at gmail.com>
Closes #8708 
Closes #8718 

ZFS on Linux/src bca0641man/man8 zfs.8

OpenZFS 10473 - zfs(1M) missing cross-reference to zfs-program(1M)

Authored by: Jason King <jason.king at joyent.com>
Reviewed by: Toomas Soome <tsoome at me.com>
Reviewed by: Andy Fiddaman <andy at omniosce.org>
Reviewed by: Peter Tribble <peter.tribble at gmail.com>
Reviewed by: Gergő Mihály Doma <domag02 at gmail.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Approved by: Dan McDonald <danmcd at joyent.com>
Ported-by: Richard Laager <rlaager at wiktel.com>

OpenZFS-issue: https://www.illumos.org/issues/10473
OpenZFS-commit: https://github.com/illumos/illumos-gate/commit/736e67003
Closes #8711 
DeltaFile
+2-1man/man8/zfs.8
+2-11 files

ZFS on Linux/src a762893module/zfs zfs_ctldir.c

Fix typo/etc in module/zfs/zfs_ctldir.c

Drop duplicated phrases in comments.

Also drop an obsolete comment "Perform a mount of the associated...",
as all it does now is get objid from DMU and lookup incore inode.

Reviewed-by: Giuseppe Di Natale <guss80 at gmail.com>
Reviewed-by: Richard Laager <rlaager at wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8707 

ZFS on Linux/src de3e0b9config kernel-totalhigh_pages.m4 kernel.m4, include/spl/sys vmsystm.h

Linux 5.0 compat: Use totalhigh_pages()

Linux kernel commit ca79b0c211af63fa3276f0e3fd7dd9ada2439839
"mm: convert totalram_pages and totalhigh_pages variables to atomic"

replaced `totalhigh_pages` with an inline function `totalhigh_pages()`.
This broke compilation on IA32, etc, as ZoL uses `totalhigh_pages`
on archs with highmem. Confirmed on Fedora 30 (5.0.9-301.fc30.i686).

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8677
Closes #8701 

ZFS on Linux/src 1eacf2bmodule/zfs zvol.c vdev_disk.c

Improve rate at which new zvols are processed

The kernel function which adds new zvols as disks to the system,
add_disk(), briefly opens and closes the zvol as part of its work.
Closing a zvol involves waiting for two txgs to sync. This, combined
with the fact that the taskq processing new zvols is single threaded,
makes this processing new zvols slow.

Waiting for these txgs to sync is only necessary if the zvol has been
written to, which is not the case during add_disk(). This change adds
tracking of whether a zvol has been written to so that we can skip the
txg_wait_synced() calls when they are unnecessary.

This change also fixes the flags passed to blkdev_get_by_path() by
vdev_disk_open() to be FMODE_READ | FMODE_WRITE | FMODE_EXCL instead of
just FMODE_EXCL. The flags were being incorrectly calculated because
we were using the wrong version of vdev_bdev_mode().

Reviewed-by: George Wilson <george.wilson at delphix.com>
Reviewed-by: Serapheim Dimitropoulos <serapheim at delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: John Gallagher <john.gallagher at delphix.com>
Closes #8526 
Closes #8615 

ZFS on Linux/src b3b6098cmd/zpool zpool_main.c

Clearer wording on Errata #4

Users of existing pools, especially pools with top-level encrypted 
datasets, could run into trouble trying to work around Errata #4. 
Clarify that removing encrypted snapshots and bookmarks is enough
to clear the errata.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Richard Laager <rlaager at wiktel.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tom Caputi <tcaputi at datto.com>
Signed-off-by: Justin Scholz <git at justinscholz.de>
Closes #8682 
Closes #8683 
DeltaFile
+26-21cmd/zpool/zpool_main.c
+26-211 files

ZFS on Linux/src 8d9f616module/zfs lz4.c

Reword comment in lz4_compress_zfs

The comment in lz4_compress_zfs could be more clear and specific.  It
also contains needlessly strong language.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Serapheim Dimitropoulos <serapheim at delphix.com>
Signed-off-by: Matthew Ahrens <mahrens at delphix.com>
Closes: #8702
Closes: #8703 
DeltaFile
+4-4module/zfs/lz4.c
+4-41 files

ZFS on Linux/src fa24166include libzfs.h, lib/libzfs libzfs_pool.c libzfs_util.c

Add feature check for 'zpool resilver' command

The 'zpool resilver' command requires that the resilver_defer
feature is active on the pool. Unfortunately, the check for
this was left out of the original patch. This commit simply
corrects this so that the command properly returns an error
in this case.

Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Igor Kozhukhov <igor at dilos.org>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Closes #8700 

ZFS on Linux/src 85bdc68cmd/zpool zpool_main.c, man/man8 zpool.8

Fix estimated scrub completion time

Currently, it is possible for the 'zpool scrub' command to
progress slightly beyond 100% due to concurrent changes
happening on the live pool. This behavior is expected, but
the userspace code for 'zpool status' would subtract the
expected amount of data from the amount of data already
scrubbed, resulting in a negative integer being casted to a
large positive one. This number was then used to calculate
the estimated completion time, resulting in wildly wrong
results. This code changes the behavior so that 'zpool status'
does not attempt to report an estimate during this period.

Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Igor Kozhukhov <igor at dilos.org>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Closes #8611 
Closes #8687 

ZFS on Linux/src 6bdefadinclude/sys dnode.h

Remove incorrect (and inappropriate) comment in dprintf_dnode

This comment seems to misunderstand the ## preprocessor token, which
does token concatenation.  It is not needed here, since we are
concatenating string literals, which is performed by putting the
literals next to each other.

Additionally, the comment uses offensive language.

Reviewed-by: Igor Kozhukhov <igor at dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Tony Nguyen <tony.nguyen at delphix.com>
Signed-off-by: Matthew Ahrens <mahrens at delphix.com>
Closes #8698
Closes #8699

ZFS on Linux/src 2a15c00cmd/zfs zfs_main.c

Use sigaction(2) instead of sigignore(3) for portability

sigignore(3) isn't portable.
This code fails to compile on platforms without sigignore(3).
Use sigaction(2).

--
zfs_main.c: In function 'zfs_do_diff':
zfs_main.c:7178:9: error: implicit declaration of function 'sigignore' 
[-Werror=implicit-function-declaration]
  (void) sigignore(SIGPIPE);
         ^~~~~~~~~

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8593
DeltaFile
+12-2cmd/zfs/zfs_main.c
+12-21 files

ZFS on Linux/src 5b1443ctests/zfs-tests/cmd/largest_file largest_file.c

Use sigaction(2) instead of sigset(3) for portability

sigset(3) isn't portable.
This code fails to compile on platforms without sigset(3).
Use sigaction(2).

--
largest_file.c: In function 'main':
largest_file.c:75:9: error: implicit declaration of function 'sigset'; did you mean 
'sigvec'? [-Werror=implicit-function-declaration]
  (void) sigset(SIGXFSZ, sigxfsz);
         ^~~~~~
         sigvec

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8593

ZFS on Linux/src f0ce043lib/libzfs libzfs_sendrecv.c, module/spl spl-err.c

Correct snprintf() size argument

The size argument of snprintf(3) in glibc and snprintf() in Linux
kernel includes trailing \0, as snprintf(3) man page explains it as
"write at most size bytes (including the trailing null byte ('\0'))",
i.e. snprintf() can just take buffer size.

e.g. For snprintf() in module/zfs/zfs_ctldir.c, a buffer size is
MAXPATHLEN, and a caller is passing MAXPATHLEN to snprintf(), so size
should just be `path_len` to do what the caller is trying to do.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Richard Laager <rlaager at wiktel.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8692 

ZFS on Linux/src 77449a1man/man8 zfs.8

Clarify that deduped data is encrypted

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Tom Caputi <tcaputi at datto.com>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8691 
DeltaFile
+2-1man/man8/zfs.8
+2-11 files

ZFS on Linux/src 294fcb5. CODE_OF_CONDUCT.md Makefile.am

Add CODE_OF_CONDUCT.md

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

ZFS on Linux/src c12ea77module/zfs vdev_disk.c

Linux 5.0 compat: Remove incorrect ASSERT

Not all block devices, notably scsi_debug, set a root_blkg on the
request queue.  Remove this assertion and allow the the existing
call to blkg_tryget() to gracefully handle the NULL (which it does).

Reviewed-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #8678 

ZFS on Linux/src b43a27fmodule/nvpair nvpair.c

Use NV_ENCODE_NATIVE for nvlist encoding variable

Use NV_ENCODE_NATIVE for nvlist encoding variable instead of 0.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Dunlop <chris at onthe.net.au>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8653 

ZFS on Linux/src 9dfe4b8config config.rpath

Prevent `make distclean` removing config/config.rpath

`make distclean` removes an empty file config/config.rpath.
Avoid that by adding some text.

Also see e1245d83e9("Prevent `make distclean` removing 0 sized file").

--
 # find . -size 0
 ./config/config.rpath
 # ./autogen.sh && ./configure
 # git diff
 # make distclean
 # git diff
 diff --git a/config/config.rpath b/config/config.rpath
 deleted file mode 100644
 index e69de29bb..000000000

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8665 

ZFS on Linux/src 126d0famodule/spl spl-vnode.c, module/zfs zfs_vnops.c zpl_inode.c

Use SEEK_{SET,CUR,END} for file seek "whence"

Use either SEEK_* or 0,1,2..., but not both.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8656 

ZFS on Linux/src f4c594dmodule/zfs dmu.c

Fixes for the DMU free throttle

This patch fixes 2 issues with the DMU free throttle implemented
in dmu_free_long_range(). The first issue is that get_next_chunk()
was calculating the number of L1 blocks the free would dirty
incorrectly. In some cases involving extremely large files, this
code would greatly overestimate the number of effected L1 blocks,
causing excessive calls to txg_wait_open(). This patch corrects
the calculation.

The second issue is that the free throttle uses the total number
of free'd blocks in all (open, quiescing, and syncing) txgs to
determine whether to throttle. This causes large frees (such as
those created by the first issue) to cause 4 txg syncs before
any further frees were allowed to proceed. This patch ensures
that the accounting is done entirely in a per-txg fashion, so
that frees from a given txg don't affect those that immediately
follow it.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens at delphix.com>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Closes #8655 
DeltaFile
+36-29module/zfs/dmu.c
+36-291 files

ZFS on Linux/src 2b127afman/man8 zfs.8

Clarify and improve encryption documentation

- Remove the language that "all user data" is encrypted.  This is to
  avoid misunderstandings or arguments about what is "user data",
  especially in light of "user properties".
- Document that properties are unencrypted.
- Document that snapshot names are unencrypted.
- For consistency with the rest of the zfs.8 man page, use "ZFS" as the
  generic noun, not (bolded) "zfs".  The latter refers to the command.
  Likewise, use "ZFS" instead of "the kernel module".
- Give "a passphrase" as an example of a "user's key".

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8652 
DeltaFile
+14-13man/man8/zfs.8
+14-131 files

ZFS on Linux/src 6e81f9bman/man8 zfs.8

Duplicate the encryption copies=3 limitation

This adds the encryption copies=3 limitation language into the copies
property section.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8651 
DeltaFile
+5-0man/man8/zfs.8
+5-01 files

ZFS on Linux/src 7b337fdman/man8 zpool.8

Deprecate dedupditto

This documents, in zpool.8, that dedupditto is deprecated and will be
made to have no effect in a future release.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens at delphix.com>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8650 
DeltaFile
+3-0man/man8/zpool.8
+3-01 files

ZFS on Linux/src 0531c83man/man5 zpool-features.5, man/man8 zstreamdump.8

Eliminate useless double-bolding in man pages

As far as I know and can tell from testing, \fB\fB...\fR\fR is exactly
equivalent to \fB...\fR.

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8641

ZFS on Linux/src a5a6d82man/man5 zpool-features.5

Alphabetize zpool-features.5 by short name

The features are sorted in the en_US locale, not the C locale.
Specifically, that means that bookmark_v2 comes _after_ bookmarks.

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8641
DeltaFile
+346-345man/man5/zpool-features.5
+346-3451 files

ZFS on Linux/src 6f07780man/man5 zpool-features.5

Standardize .RE placement in zpool-features.5

This command is being used to unindent, so it should be at the end of
each block.  This is consistent with the other man pages.

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8641

ZFS on Linux/src 1644708man/man5 zpool-features.5

Add missing formatting to sha512 in zpool-features.5

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8641

ZFS on Linux/src e182291man/man5 zpool-features.5

Correct GUID of large_blocks in zpool-features.5

It is org.open-zfs:large_blocks (plural).

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8641

ZFS on Linux/src d0c3aa9man/man5 zfs-module-parameters.5

Change wording in zfs-module-parameters.5

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8641

ZFS on Linux/src 063edd7man/man5 zpool-features.5

Document that hole_birth is effectively useless

The first sentence of this commit comes from the wiki, and was
originally written by:
Rich Ercolani <rincebrain at gmail.com>
with changes by:
Tom Caputi <tcaputi at datto.com>

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8641
Closes #8642

ZFS on Linux/src 6ce7b2dman/man5 zfs-module-parameters.5

Document send_holes_without_birth_time

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8641