ZFS on Linux/src e8864b1config lib-link.m4 host-cpu-c-abi.m4

config: libintl/libiconv for gettext() detection

Detect in autoconf whether `-lintl` and possibly `-liconv` are necessary
for translation functions like `gettext()`.

The actual autoconf code is just:

```
AM_ICONV
AM_GNU_GETTEXT([external])
LIBS="$LIBS $LTLIBINTL $LTLIBICONV"
```

References:

https://www.gnu.org/software/gettext/manual/html_node/AM_005fGNU_005fGETTEXT.html
https://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html

The reason to check for `libiconv` and add it separately is that this is
sometimes necessary if users are linking statically.

The `config/*.m4` files were added by running `gettextize` and removing
everything else.

The empty file `config/config.rpath` is necessary to avoid an error with

    [12 lines not shown]

ZFS on Linux/src 34d343cmodule/zfs zfs_znode.c

Drop unused ZNODE_STATS and ZNODE_STAT_ADD()

Unused since 5649246dd3("Remove znode move functionality"),
and ZNODE_STAT_ADD() will never be needed.

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

ZFS on Linux/src f8b2ca6lib/libzfs_core libzfs_core.c

Fix typo "/zbin/zpool" -> "/sbin/zpool"

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

ZFS on Linux/src a35c120module/zfs zfs_vnops.c

Fix incorrect "[UNUSED]" comments

These aren't unused.
`flag` in zfs_create() also isn't to indicate large file.

Reviewed-by: Richard Elling <Richard.Elling at RichardElling.com>
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 #8635 

ZFS on Linux/src 17cbc2e. META

Tag 0.8.0-rc4

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

ZFS on Linux/src 5090f72man/man5 zfs-module-parameters.5, module/zfs qat_crypt.c qat_compress.c

Code improvement and bug fixes for QAT support

1. Support QAT when ZFS is root file-system:
   When ZFS module is loaded before QAT started, the QAT can
   be started again in post-process, e.g.:
   echo 0 > /sys/module/zfs/parameters/zfs_qat_compress_disable
   echo 0 > /sys/module/zfs/parameters/zfs_qat_encrypt_disable
   echo 0 > /sys/module/zfs/parameters/zfs_qat_checksum_disable
2. Verify alder checksum of the de-compress result
3. Allocate Digest, IV and AAD buffer in physical contiguous
   memory by QAT_PHYS_CONTIG_ALLOC.
4. Update the documentation for zfs_qat_compress_disable,
   zfs_qat_checksum_disable, zfs_qat_encrypt_disable.

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Weigang Li <weigang.li at intel.com>
Signed-off-by: Chengfeix Zhu <chengfeix.zhu at intel.com>
Closes #8323 
Closes #8610 

ZFS on Linux/src 59f6594module/icp/io sha1_mod.c sha2_mod.c

Restructure vec_idx loops

This replaces empty for loops with while loops to make the code easier
to read.

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reported-by: github.com/dcb314
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #6681
Closes #6682
Closes #6683
Closes #8623 

ZFS on Linux/src 50478c6cmd/zfs zfs_main.c, cmd/zpool zpool_main.c

Add option [-V|--version] to emit version string

Add the 'zfs version' and 'zpool version' subcommands to display
the version of the user space utilities and loaded zfs kernel
module.  For example:

$ zfs version
zfs-0.8.0-rc3_169_g67e0366b88
zfs-kmod-0.8.0-rc3_169_g67e0366b88

The '-V' and '--version' aliases were added to support the
common convention of using 'zfs --version` to obtain the version
information.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens at delphix.com>
Reviewed-by: Richard Laager <rlaager at wiktel.com>
Signed-off-by: TerraTech <1118433+TerraTech at users.noreply.github.com>
Closes #2501
Closes #8567

ZFS on Linux/src 8750edfman/man8 zfs.8

zfs allow refreservation needed for zfs create -V

When creating a non-sparse volume, zfs create sets a refreservation.
Accordingly, one needs the "refreservation" ability in addition to the
"create" ability in order to create a non-sparse volume.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reported-by: github.com/homerlinux
Reported-by: Matthew Ahrens <mahrens at delphix.com>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8531
Closes #8624
DeltaFile
+3-1man/man8/zfs.8
+3-11 files

ZFS on Linux/src 6c0f78fman/man5 zpool-features.5, man/man8 zfs.8

Clarify GRUB's lack of support for sha512, skein, edonr

zfs.8 correctly said that GRUB did not support them, but
zpool-features.5 said that "Booting off pools...is supported."  Now,
zpool-features.5 discusses GRUB specifically and indicates its lack of
support for these features.  Also, I have clarified the wording in both
places to indicate that the pool feature cannot be used.  It's not a
filesystem dataset thing, but pool-wide.

I described this as "cannot be used".  I think technically the feature
can be enabled, just not active.  However, the effect is essentially the
same: you cannot enable those checksum algorithms on any dataset in the
pool, so you might as well not enable the feature (which is just
pointing a loaded gun at your foot).  In the past, an argument could be
made that having all the features enabled was useful for simplicity, as
long as you didn't activate the GRUB-incompatible features, but that's
getting less and less realistic over time.  A user can still do that,
but we should not encourage that.

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 #8626
Closes #8446

ZFS on Linux/src fcf21f8module/zfs spa.c

Update a comment to match the code

GRUB supports large_blocks.

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 #8626
DeltaFile
+2-2module/zfs/spa.c
+2-21 files

ZFS on Linux/src 8dda07binclude/sys/fs zfs.h

Reference zfeature.c in a SPA_VERSION comment

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 #8626

ZFS on Linux/src 7698c4einclude/sys/fs zfs.h

Remove zfs.h comments about GRUB

Nobody is going to be bumping SPA_VERSION again, as OpenZFS has moved on
to feature flags.  Also, there is no requirement to keep GRUB
up-to-date, nor has that been happening.

The ZPL_VERSION could be bumped, but that would likely be handled in a
similar way, by adding filesystem feature flags.  In any event, we do
not need this comment, and we certainly don't need a reference to the
GRUB 0.97 source code in a Solaris tree.

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 #8626

ZFS on Linux/src 7886aa8man/man5 zpool-features.5

Reword the dedup limitation for Edon-R

The old wording was effectively "You can not use this (except you can)",
which just seems confusing.

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 #8626

ZFS on Linux/src 393363cman/man5 zpool-features.5, module/zfs zfeature.c

Consistently captialize GUID for features

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 #8626

ZFS on Linux/src 612c493man/man5 zpool-features.5, module/zfs zil.c

Fix the spelling of deferred

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 #8626

ZFS on Linux/src c349137man/man8 zdb.8

Update zdb.8's fsck reference

On Linux, this is in man section 8, not 1M.  Also, there is no fsdb on
Linux, so I removed that.

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 #8626
DeltaFile
+2-4man/man8/zdb.8
+2-41 files

ZFS on Linux/src 9042ca0man/man5 zpool-features.5

Refer to commands consistently in zpool-features.5

This had a mix of command vs subcommand, quoted vs not quoted, and
bolded vs. not bolded command names.

Also, fix man page sections from 1M (Solaris) to 8 (Linux).

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 #8626

ZFS on Linux/src 9810410man/man8 zpool.8 zfs.8

Eliminate most mentions of "special"

Previously, the "spare" vdev type was described as "A special
pseudo-vdev which...".  I wanted to eliminate the word "special" from
that, now that the allocation_classes feature exists and there is such a
thing as a "special vdev".  I ended up eliminating almost all instances
of the word "special" that are not referencing the allocation_classes
feature.

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 #8626

ZFS on Linux/src c2c6eadmodule/zfs dmu_recv.c, tests/runfiles linux.run

Fix issues with truncated files in raw sends

When receiving a raw send stream only reallocated objects
whose contents were not freed by the standard indicators
should call dmu_free_long_range().

Furthermore, if calling dmu_free_long_range() is required
then the objects current block size must be used and not
the new block size.

Two additional test cases were added to provided realistic
test coverage for processing reallocated objects which are
part of a raw receive.

Reviewed-by: Olaf Faaland <faaland1 at llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Closes #8528
Closes #8607

ZFS on Linux/src 83472falib/libzfs libzfs_sendrecv.c, tests/runfiles linux.run

Fix hierarchy misspellings

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reported-by: Matthew Ahrens <mahrens at delphix.com>
Signed-off-by: Richard Laager <rlaager at wiktel.com>
Closes #8563
Closes #8622

ZFS on Linux/src 703f791tests/zfs-tests/cmd/libzfs_input_check libzfs_input_check.c

Don't hard-code number of ioctls for portability

Use (ZFS_IOC_LAST - ZFS_IOC_FIRST) instead of 256.
It seems 256 is just a number large enough to hold ioctls
at the moment.

Using 256 also causes compile-time warning or error
on platfoms whose enum zfs_ioc definition differs.

Reviewed-by: Olaf Faaland <faaland1 at llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Igor Kozhukhov <igor at dilos.org>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8598

ZFS on Linux/src 96e51d2include/sys/fs zfs.h

Sync reserved Illumos ioctl comment with actual number

It's 81 now.

Reviewed-by: Olaf Faaland <faaland1 at llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Igor Kozhukhov <igor at dilos.org>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8598

ZFS on Linux/src d5d2ef2config always-compiler-options.m4 zfs-build.m4

compile with -fno-omit-frame-pointer

By default, depending on the version, gcc can reuse the frame pointer register.
This is a micro-optimization that might help on some very old x86 processors.
However, it also makes dynamic tracing less useful because the stacks cannot
be easily observed.

This rule change instructs gcc to use the -fno-omit-frame-pointer option
when compiling.

Reviewed-by: Olaf Faaland <faaland1 at llnl.gov>
Reviewed by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Richard Elling <Richard.Elling at RichardElling.com>
Closes #8617 

ZFS on Linux/src 7dcd318cmd/zinject zinject.c, module/zfs vdev_mirror.c

Cleanup nits from ab7615d92

This patch simply up cleans up a nit and corrects an error message
issue that were introduced in the Multiple DVA scrub patch.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Closes #8619 

ZFS on Linux/src b92f5d9module/zfs dmu_recv.c, tests/runfiles linux.run

Fix issue in receive_object() during reallocation

When receiving an object to a previously allocated interior slot
the new object should be "allocated" by setting DMU_NEW_OBJECT,
not "reallocated" with dnode_reallocate().  For resilience verify
the slot is free as required in case the stream is malformed.

Add a test case to generate more realistic incremental send streams
that force reallocation to occur during the receive.

Reviewed-by: Olaf Faaland <faaland1 at llnl.gov>
Reviewed-by: Tom Caputi <tcaputi at datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #8067 
Closes #8614 

ZFS on Linux/src 3fa93bbmodule/zfs dnode.c dsl_dir.c

Fix TXG_MASK cstyle

Fix style issue for 'tx->tx_txg&TXG_MASK'.  There should be white
space around the '&' character.  Split the dnode_reallocate() ASSERT
to make it more readable to clearly separate the checks.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Tom Caputi <tcaputi at datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #8606 

ZFS on Linux/src 9e3485atests/zfs-tests/tests/functional/fault auto_online_001_pos.ksh

ZTS: Make fault cleanup function more robust

The cleanup function of auto_online_001_pos does not account for the
possibility that the test may fail while a disk is still removed. If
the test run is using real disks, cleanup should involve restoring any
that are missing.

Reviewed-by: Giuseppe Di Natale <guss80 at gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: John Kennedy <john.kennedy at delphix.com>
Closes #8579 

ZFS on Linux/src b31cf30tests/test-runner/bin test-runner.py

Allow zfs-tests to recover from hibernation

When a system sleeps during a zfs-test, the time spent
hibernating is counted against the test's runtime even
though the test can't and isn't running.
This patch tries to detect timeouts due to hibernation and
reruns tests that timed out due to system sleeping.
In this version of the patch, the existing behavior of returning
non-zero when a test was killed is preserved. With this patch applied
we still return nonzero and we also automatically rerun the test we
suspect of being killed due to system hibernation.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed by: John Kennedy <john.kennedy at delphix.com>
Signed-off-by: Alek Pinchuk <apinchuk at datto.com>
Closes #8575 

ZFS on Linux/src 48ed0f9module/zfs zio_crypt.c

Always call rw_init in zio_crypt_key_unwrap

The error path in zio_crypt_key_unwrap would call zio_crypt_key_destroy which
calls rw_destroy(&key->zk_salt_lock); which has not yet been initialized.

We move the rw_init() call to the start of zio_crypt_key_unwrap instead.

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Jorgen Lundman <lundman at lundman.net>
Closes #8604
Closes #8605 

ZFS on Linux/src 8cb3442module/zfs zfs_vnops.c

Avoid stack overwrite in zfs_setattr_dir()

The bulk[] array index, count, must be reset per-iteration in order to
not overwrite the stack.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Chris Dunlop <chris at onthe.net.au>
Reviewed-by: Tom Caputi <tcaputi at datto.com>
Signed-off-by: Tim Chase <tim at chase2k.com>
Closes #8072
Closes #8597
Closes #8601 

ZFS on Linux/src 5ae4e44lib/libzpool kernel.c

Don't assume pthread_t is uint_t for portability

POSIX doesn't define pthread_t as uint_t. It could be a pointer.
This code causes below compile error on a platform using pointer
for pthread_t.

--
kernel.c:815:25: error: cast from pointer to integer of different size 
[-Werror=pointer-to-int-cast]
    (void) printf("%u ", (uint_t)pthread_self());

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Igor Kozhukhov <igor at dilos.org>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8558 

ZFS on Linux/src 9a65234include/spl/sys proc.h, module/spl spl-kstat.c

Unbreak build on Linux kernel < 3.10

d12614521a("Fixes for procfs files backed by linked lists")
uses PDE_DATA(), but since PDE_DATA() (public interface which
replaced old public interface PDE()) first appeared in upstream
kernel 3.10, it lacks visible local definition for kernel < 3.10.

Move the local PDE_DATA() definition to a ZoL header, to unbreak
build on kernel < 3.10.

--
module/spl/spl-procfs-list.c: In function 'procfs_list_open':
module/spl/spl-procfs-list.c:166: error: implicit declaration of function 'PDE_DATA'
module/spl/spl-procfs-list.c:166: warning: assignment makes pointer from integer without a 
cast

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: John Gallagher <john.gallagher at delphix.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Closes #8599 

ZFS on Linux/src c375c69cmd/zfs zfs_main.c

Fix 'zfs list -t snapshot' depth

Commit df583073 introduced the ability to list the snapshots for a
specified dataset.  This change inadvertently resulted in only the top-
level snapshots being listed when no dataset was specified.  Fix this
issue by adding an additional check to determine if a dataset was
provided to avoid incorrectly restricting the depth.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Tom Caputi <tcaputi at datto.com>
Reviewed-by: Alek Pinchuk <apinchuk at datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #8591 
Closes #8594 
DeltaFile
+2-2cmd/zfs/zfs_main.c
+2-21 files

ZFS on Linux/src ac4985elib/libzfs_core libzfs_core.c

Fix buffer length in strlcpy()

The length used for the strlcpy() used the size of zv_value
when it should have used the size of zc_name.  Correct this
typo.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Jorgen Lundman <lundman at lundman.net>
Reviewed-by: Igor Kozhukhov <igor at dilos.org>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #8595
Closes #8596 

ZFS on Linux/src d93d4b1module/zfs dmu_recv.c dnode.c, tests/runfiles linux.run

Revert "Fix issues with truncated files in raw sends"

This partially reverts commit 5dbf8b4ed.  This change resolved
the issues observed with truncated files in raw sends.  However,
the required changes to dnode_allocate() introduced a regression
for non-raw streams which needs to be understood.

The additional debugging improvements from the original patch
were not reverted.

Reviewed-by: Tom Caputi <tcaputi at datto.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Issue #7378
Issue #8528
Issue #8540
Issue #8565
Close #8584

ZFS on Linux/src 944a372module/zfs spa.c

predictive prefetch disabled on new pools until export/reboot

When a pool is initially created (by `zpool create`), predictive
prefetch is inadvertently disabled, until the pool is export/import-ed,
or the machine is rebooted.

When device removal was introduced, we added some code to disable
predictive prefetching until indirect vdevs have been loaded.  This
resulted in the "default state" of prefetch being disabled, until we
proactively enable it after indirect vdevs are loaded.  Unfortunately
this resulted in a few bugs where in some code paths we neglect to
enable predictive prefetch.  The first of these was fixed by
https://github.com/zfsonlinux/zfs/commit/20507534d4ede14d4dd82c99fc8d461704ce7419

This commit fixes another case where we also need to explicitly enable
predictive prefetch, when the pool is initially created.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Richard Elling <Richard.Elling at RichardElling.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Matthew Ahrens <mahrens at delphix.com>
Closes #8577 
DeltaFile
+2-1module/zfs/spa.c
+2-11 files

ZFS on Linux/src b4ddec7module/zfs zfs_sysfs.c, tests/zfs-tests/tests/functional/cli_root/zfs_sysfs zfs_sysfs_live.ksh

features.kernel layout should match features.pool

The features.kernel layout should match features.pool.

Reviewed-by: Sara Hartse <sara.hartse at delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Don Brady <don.brady at delphix.com>
Closes #8566 

ZFS on Linux/src a887d65module/spl spl-kstat.c spl-procfs-list.c, module/zfs zio.c spa_stats.c

Restrict kstats and print real pointers

There are several places where we use zfs_dbgmsg and %p to
print pointers. In the Linux kernel, these values obfuscated
to prevent information leaks which means the pointers aren't
very useful for debugging crash dumps. We decided to restrict
the permissions of dbgmsg (and some other kstats while we were
at it) and print pointers with %px in zfs_dbgmsg as well as
spl_dumpstack

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: John Gallagher <john.gallagher at delphix.com>
Signed-off-by: sara hartse <sara.hartse at delphix.com>
Closes #8467 
Closes #8476 

ZFS on Linux/src af65079man/man8 zpool.8

Hint about zpool free vs zfs available

Also describe free/allocated/fragmentation

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Matt Ahrens <mahrens at delphix.com>
Signed-off-by: Josh Soref <jsoref at users.noreply.github.com>
Closes #7565 
Closes #8483 
DeltaFile
+25-1man/man8/zpool.8
+25-11 files

ZFS on Linux/src f4e35b1module/zfs txg.c zthr.c

Fix txg_wait_open() load average inflation

Callers of txg_wait_open() which set should_quiesce=B_TRUE should be
accounted for as iowait time.  Otherwise, the caller is understood
to be idle and cv_wait_sig() is used to prevent incorrectly inflating
the system load average.

Similarly txg_wait_wait() has been updated to use cv_wait_io() to
be accounted against iowait.

Reviewed-by: Tim Chase <tim at chase2k.com>
Reviewed-by: Olaf Faaland <faaland1 at llnl.gov>
Reviewed-by: Matt Ahrens <mahrens at delphix.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #8550
Closes #8558 

ZFS on Linux/src ce4432ccontrib/dracut/90zfs zfs-env-bootfs.service.in Makefile.am, etc/systemd/system zfs-import-scan.service.in zfs-import-cache.service.in

Move dracut specifics to dracut module

Dracut depends on the environment variable BOOTFS to be set after pool
import. This dracut specific systemd ExecStartPost command should not be
called for any non-dracut systems, so let's move it to a static systemd
unit that.

Reviewed-by: Manuel Amador (Rudd-O) <rudd-o at rudd-o.com>
Reviewed-by: Matthew Thode <prometheanfire at gentoo.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Michael Niewöhner <foss at mniewoehner.de>
Closes #8510 

ZFS on Linux/src f72ecb8man/man8 zpool.8

Fix man(1) warnings

The macOS man app strenuously objects to blank lines in man files.

mdoc warning: Empty input line #xyz

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: bunder2015 <omfgbunder at gmail.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Josh Soref <jsoref at users.noreply.github.com>
Closes #8559 
DeltaFile
+3-3man/man8/zpool.8
+3-31 files

ZFS on Linux/src bd15ac7lib/libzfs libzfs_sendrecv.c

Append snapshot name to "TIME SENT SNAPSHOT" output

Simply appends zhp->zfs_name to the "TIME SENT SNAPSHOT" output.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Matt Ahrens <mahrens at delphix.com>
Reviewed-by: Richard Elling <Richard.Elling at RichardElling.com>
Signed-off-by: TerraTech <TerraTech at users.noreply.github.com>
Closes #8543 

ZFS on Linux/src df58307cmd/zfs zfs_iter.c zfs_main.c, tests/zfs-tests/include libtest.shlib

Do not iterate through filesystems unnecessarily

Currently, when attempting to list snapshots ZFS may do a lot of
extra work checking child datasets. This is because the code does
not realize that it will not be able to reach any snapshots
contained within snapshots that are at the depth limit since the
snapshots of those datasets are counted as an additional layer
deeper. This patch corrects this issue.

In addition, this patch adds the ability to do perform the commands:

$ zfs list -t snapshot <dataset>
$ zfs get -t snapshot <prop> <dataset>

as a convenient way to list out properties of all snapshots of a
given dataset without having to use the depth limit.

Reviewed-by: Alek Pinchuk <apinchuk at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Richard Laager <rlaager at wiktel.com>
Reviewed-by: Matt Ahrens <mahrens at delphix.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Closes #8539 

ZFS on Linux/src e03b25aetc/systemd/system zfs-import-cache.service.in zfs-import-scan.service.in

Fix systemd-import services

On debian, systemd complains about missing /bin/awk because it
actually is located at /usr/bin/awk. It is not a good idea to
hardcode binary paths because different linux distros use different
paths. According to systemd's man page it is absolutely safe to
miss paths for binaries located at standard locations (/bin,
/sbin, /usr/bin, ...).

Further, replace this more or less complicated awk command by
grep.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Michael Niewöhner <foss at mniewoehner.de>
Issue #8510

ZFS on Linux/src 3b26189etc/systemd/system zfs-import-scan.service.in zfs-import-cache.service.in

Remove hard dependency on bash

zfs-import-* services have a hard dependency on bash while not
everyone has bash installed. At this point /bin/sh is sufficient,
so use that.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Michael Niewöhner <foss at mniewoehner.de>
Issue #8510

ZFS on Linux/src dd29864man/man8 zfs.8

Update raw send documentation

This patch simply clarifies some of the limitations related to
raw sends in the man page. No functional changes.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Jason Cohen <jwittlincohen at gmail.com>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Closes #8503
Closes #8544 
DeltaFile
+14-4man/man8/zfs.8
+14-41 files

ZFS on Linux/src 1b93956cmd/zpool zpool_main.c, lib/libzfs libzfs_pool.c

Add TRIM support

UNMAP/TRIM support is a frequently-requested feature to help
prevent performance from degrading on SSDs and on various other
SAN-like storage back-ends.  By issuing UNMAP/TRIM commands for
sectors which are no longer allocated the underlying device can
often more efficiently manage itself.

This TRIM implementation is modeled on the `zpool initialize`
feature which writes a pattern to all unallocated space in the
pool.  The new `zpool trim` command uses the same vdev_xlate()
code to calculate what sectors are unallocated, the same per-
vdev TRIM thread model and locking, and the same basic CLI for
a consistent user experience.  The core difference is that
instead of writing a pattern it will issue UNMAP/TRIM commands
for those extents.

The zio pipeline was updated to accommodate this by adding a new
ZIO_TYPE_TRIM type and associated spa taskq.  This new type makes
is straight forward to add the platform specific TRIM/UNMAP calls
to vdev_disk.c and vdev_file.c.  These new ZIO_TYPE_TRIM zios are
handled largely the same way as ZIO_TYPE_READs or ZIO_TYPE_WRITEs.
This makes it possible to largely avoid changing the pipieline,
one exception is that TRIM zio's may exceed the 16M block size
limit since they contain no data.

    [29 lines not shown]

ZFS on Linux/src f94b3cblib/libzfs libzfs_sendrecv.c

Send stream should only list included snaps

Currently, zfs send streams will include a list of all snapshots
on the source side if the '-p' option is provided. This can cause
performance problems on the receive side, especially if those
snapshots aren't present on the destination. These problems arise
because guid_to_name(), which is used for several receive side
functions, will search the entire receive-side pool if it can't
find a snapshot with a matching guid. This patch corrects the
issue by ensuring only streams that require this list of snapshots
include them.

Reviewed-by: Alek Pinchuk <apinchuk at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Matt Ahrens <mahrens at delphix.com>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Closes #8533