Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zfs-0.8.3 patchset #9776

Closed
wants to merge 175 commits into from

Commits on Dec 23, 2019

  1. make zil max block size tunable

    We've observed that on some highly fragmented pools, most metaslab
    allocations are small (~2-8KB), but there are some large, 128K
    allocations.  The large allocations are for ZIL blocks.  If there is a
    lot of fragmentation, the large allocations can be hard to satisfy.
    
    The most common impact of this is that we need to check (and thus load)
    lots of metaslabs from the ZIL allocation code path, causing sync writes
    to wait for metaslabs to load, which can take a second or more.  In the
    worst case, we may not be able to satisfy the allocation, in which case
    the ZIL will resort to txg_wait_synced() to ensure the change is on
    disk.
    
    To provide a workaround for this, this change adds a tunable that can
    reduce the size of ZIL blocks.
    
    External-issue: DLPX-61719
    Reviewed-by: George Wilson <george.wilson@delphix.com>
    Reviewed-by: Paul Dagnelie <pcd@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
    Closes openzfs#8865
    ahrens authored and tonyhutter committed Dec 23, 2019
    Configuration menu
    Copy the full SHA
    48d1439 View commit details
    Browse the repository at this point in the history
  2. single-chunk scatter ABDs can be treated as linear

    Scatter ABD's are allocated from a number of pages.  In contrast to
    linear ABD's, these pages are disjoint in the kernel's virtual address
    space, so they can't be accessed as a contiguous buffer.  Therefore
    routines that need a linear buffer (e.g. abd_borrow_buf() and friends)
    must allocate a separate linear buffer (with zio_buf_alloc()), and copy
    the contents of the pages to/from the linear buffer.  This can have a
    measurable performance overhead on some workloads.
    
    openzfs@87c25d5
    ("abd_alloc should use scatter for >1K allocations") increased the use
    of scatter ABD's, specifically switching 1.5K through 4K (inclusive)
    buffers from linear to scatter.  For workloads that access blocks whose
    compressed sizes are in this range, that commit introduced an additional
    copy into the read code path.  For example, the
    sequential_reads_arc_cached tests in the test suite were reduced by
    around 5% (this is doing reads of 8K-logical blocks, compressed to 3K,
    which are cached in the ARC).
    
    This commit treats single-chunk scattered buffers as linear buffers,
    because they are contiguous in the kernel's virtual address space.
    
    All single-page (4K) ABD's can be represented this way.  Some multi-page
    ABD's can also be represented this way, if we were able to allocate a
    single "chunk" (higher-order "page" which represents a power-of-2 series
    of physically-contiguous pages).  This is often the case for 2-page (8K)
    ABD's.
    
    Representing a single-entry scatter ABD as a linear ABD has the
    performance advantage of avoiding the copy (and allocation) in
    abd_borrow_buf_copy / abd_return_buf_copy.  A performance increase of
    around 5% has been observed for ARC-cached reads (of small blocks which
    can take advantage of this), fixing the regression introduced by
    87c25d5.
    
    Note that this optimization is only possible because all physical memory
    is always mapped into the kernel's address space.  This is not the case
    for HIGHMEM pages, so the optimization can not be made on 32-bit
    systems.
    
    Reviewed-by: Chunwei Chen <tuxoko@gmail.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
    Closes openzfs#8580
    ahrens authored and tonyhutter committed Dec 23, 2019
    Configuration menu
    Copy the full SHA
    6894c2e View commit details
    Browse the repository at this point in the history
  3. looping in metaslab_block_picker impacts performance on fragmented pools

    On fragmented pools with high-performance storage, the looping in
    metaslab_block_picker() can become the performance-limiting bottleneck.
    When looking for a larger block (e.g. a 128K block for the ZIL), we may
    search through many free segments (up to hundreds of thousands) to find
    one that is large enough to satisfy the allocation. This can take a long
    time (up to dozens of ms), and is done while holding the ms_lock, which
    other threads may spin waiting for.
    
    When this performance problem is encountered, profiling will show
    high CPU time in metaslab_block_picker, as well as in mutex_enter from
    various callers.
    
    The problem is very evident on a test system with a sync write workload
    with 8K writes to a recordsize=8k filesystem, with 4TB of SSD storage,
    84% full and 88% fragmented. It has also been observed on production
    systems with 90TB of storage, 76% full and 87% fragmented.
    
    The fix is to change metaslab_df_alloc() to search only up to 16MB from
    the previous allocation (of this alignment). After that, we will pick a
    segment that is of the exact size requested (or larger). This reduces
    the number of iterations to a few hundred on fragmented pools (a ~100x
    improvement).
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Paul Dagnelie <pcd@delphix.com>
    Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
    Reviewed-by: George Wilson <george.wilson@delphix.com>
    Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
    Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
    External-issue: DLPX-62324
    Closes openzfs#8877
    ahrens authored and tonyhutter committed Dec 23, 2019
    Configuration menu
    Copy the full SHA
    193d598 View commit details
    Browse the repository at this point in the history

Commits on Dec 27, 2019

  1. OpenZFS 9425 - channel programs can be interrupted

    Problem Statement
    =================
    ZFS Channel program scripts currently require a timeout, so that hung or
    long-running scripts return a timeout error instead of causing ZFS to get
    wedged. This limit can currently be set up to 100 million Lua instructions.
    Even with a limit in place, it would be desirable to have a sys admin
    (support engineer) be able to cancel a script that is taking a long time.
    
    Proposed Solution
    =================
    Make it possible to abort a channel program by sending an interrupt signal.In
    the underlying txg_wait_sync function, switch the cv_wait to a cv_wait_sig to
    catch the signal. Once a signal is encountered, the dsl_sync_task function can
    install a Lua hook that will get called before the Lua interpreter executes a
    new line of code. The dsl_sync_task can resume with a standard txg_wait_sync
    call and wait for the txg to complete.  Meanwhile, the hook will abort the
    script and indicate that the channel program was canceled. The kernel returns
    a EINTR to indicate that the channel program run was canceled.
    
    Porting notes: Added missing return value from cv_wait_sig()
    
    Authored by: Don Brady <don.brady@delphix.com>
    Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
    Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
    Reviewed by: Matt Ahrens <matt@delphix.com>
    Reviewed by: Sara Hartse <sara.hartse@delphix.com>
    Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
    Approved by: Robert Mustacchi <rm@joyent.com>
    Ported-by: Don Brady <don.brady@delphix.com>
    Signed-off-by: Don Brady <don.brady@delphix.com>
    
    OpenZFS-issue: https://www.illumos.org/issues/9425
    OpenZFS-commit: illumos/illumos-gate@d0cb1fb926
    Closes openzfs#8904
    Don Brady authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    0701572 View commit details
    Browse the repository at this point in the history
  2. Fix bp_embedded_type enum definition

    With the addition of BP_EMBEDDED_TYPE_REDACTED in 30af21b a couple of
    codepaths make wrong assumptions and could potentially result in errors.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Chris Dunlop <chris@onthe.net.au>
    Reviewed-by: Paul Dagnelie <pcd@delphix.com>
    Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
    Closes openzfs#8951
    Conflicts:
    	include/sys/spa.h
    loli10K authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    320dad7 View commit details
    Browse the repository at this point in the history
  3. Concurrent small allocation defeats large allocation

    With the new parallel allocators scheme, there is a possibility for
    a problem where two threads, allocating from the same allocator at
    the same time, conflict with each other. There are two primary cases
    to worry about. First, another thread working on another allocator
    activates the same metaslab that the first thread was trying to
    activate. This results in the first thread needing to go back and
    reselect a new metaslab, even though it may have waited a long time
    for this metaslab to load. Second, another thread working on the same
    allocator may have activated a different metaslab while the first
    thread was waiting for its metaslab to load. Both of these cases
    can cause the first thread to be significantly delayed in issuing
    its IOs. The second case can also cause metaslab load/unload churn;
    because the metaslab is loaded but not fully activated, we never set
    the selected_txg, which results in the metaslab being immediately
    unloaded again. This process can repeat many times, wasting disk and
    cpu resources. This is more likely to happen when the IO of the first
    thread is a larger one (like a ZIL write) and the other thread is
    doing a smaller write, because it is more likely to find an
    acceptable metaslab quickly.
    
    There are two primary changes. The first is to always proceed with
    the allocation when returning from metaslab_activate if we were
    preempted in either of the ways described in the previous section.
    The second change is to set the selected_txg before we do the call
    to activate so that even if the metaslab is not used for an
    allocation, we won't immediately attempt to unload it.
    
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Matt Ahrens <matt@delphix.com>
    Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
    Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Paul Dagnelie <pcd@delphix.com>
    External-issue: DLPX-61314
    Closes openzfs#8843
    pcd1193182 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    4879d2b View commit details
    Browse the repository at this point in the history
  4. OpenZFS 9318 - vol_volsize_to_reservation does not account for raidz …

    …skip blocks
    
    When a volume is created in a pool with raidz vdevs and
    volblocksize != 128k, the volume can reference more space than is
    reserved with the automatically calculated refreservation.  There
    are two deficiencies in vol_volsize_to_reservation that contribute
    to this:
    
      1) Skip blocks may be added to keep each allocation a multiple
         of parity + 1. This is the dominating factor when volblocksize
         is close to 2^ashift.
    
      2) raidz deflation for 128 KB blocks is different for most other
         block sizes.
    
    See "The theory of raidz space accounting" comment in
    libzfs_dataset.c for a full explanation.
    
    Authored by: Mike Gerdts <mike.gerdts@joyent.com>
    Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
    Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Matt Ahrens <matt@delphix.com>
    Reviewed by: Kody Kantor <kody.kantor@joyent.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Approved by: Dan McDonald <danmcd@joyent.com>
    Ported-by: Mike Gerdts <mike.gerdts@joyent.com>
    
    Porting Notes:
    * ZTS: wait for zvols to exist before writing
    * ZTS: use log_must_busy with {zpool|zfs} destroy
    
    OpenZFS-issue: https://www.illumos.org/issues/9318
    OpenZFS-commit: illumos/illumos-gate@b73ccab0
    Closes openzfs#8973
    Mike Gerdts authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    8a8bedc View commit details
    Browse the repository at this point in the history
  5. Don't activate metaslabs with weight 0

    We return ENOSPC in metaslab_activate if the metaslab has weight 0,
    to avoid activating a metaslab with no space available.  For sanity
    checking, we also assert that there is no free space in the range
    tree in that case.
    
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed by: Matt Ahrens <matt@delphix.com>
    Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
    Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Paul Dagnelie <pcd@delphix.com>
    Closes openzfs#8968
    pcd1193182 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    12ffb25 View commit details
    Browse the repository at this point in the history
  6. install path fixes

    * rpm: correct pkgconfig path
    
    pkconfig files get installed to $datarootdir/pkgconfig but rpm expects
    them to be at $datadir. This works when $datarootdir==$datadir which is
    the case most of the time but will fail when they differ.
    
    * install: make initramfs-tools path static
    
    Since initramfs-tools' path is nothing we can control as it is an
    external package it does not make any sense to install zfs additions
    anywhere else. Simply use /usr/share/initramfs-tools as path.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
    Closes openzfs#9087
    c0d3z3r0 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    9b68e14 View commit details
    Browse the repository at this point in the history
  7. Add channel program for property based snapshots

    Channel programs that many users find useful should be included with zfs
    in the /contrib directory. This is the first of these contributions. A
    channel program to recursively take snapshots of datasets with the
    property com.sun:auto-snapshot=true.
    
    Reviewed-by: Kash Pande <kash@tripleback.net>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Clint Armstrong <clint@clintarmstrong.net>
    Closes openzfs#8443
    Closes openzfs#9050
    clinta authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    5ecf5c1 View commit details
    Browse the repository at this point in the history
  8. lockdep false positive - move txg_kick() outside of ->dp_lock

    This fixes a lockdep warning by breaking a link between ->tx_sync_lock
    and ->dp_lock.
    
    The deadlock envisioned by lockdep is this:
        thread 1 holds db->db_mtx and tries to get dp->dp_lock:
    	dsl_pool_dirty_space+0x70/0x2d0 [zfs]
    	dbuf_dirty+0x778/0x31d0 [zfs]
    
        thread 2 holds bpo->bpo_lock and tries to get db->db_mtx:
            dmu_buf_will_dirty_impl
            dmu_buf_will_dirty+0x6b/0x6c0 [zfs]
            bpobj_iterate_impl+0xbe6/0x1410 [zfs]
    
        thread 3 holds tx->tx_sync_lock and tries to get bpo->bpo_lock:
            bpobj_space+0x63/0x470 [zfs]
            dsl_scan_active+0x340/0x3d0 [zfs]
            txg_sync_thread+0x3f2/0x1370 [zfs]
    
        thread 4 holds dp->dp_lock and tries to get tx->tx_sync_lock
           txg_kick+0x61/0x420 [zfs]
           dsl_pool_need_dirty_delay+0x1c7/0x3f0 [zfs]
    
    This patch is orginally from Brian Behlendorf and slightly simplified
    by me.
    
    It breaks this cycle in thread 4 by moving the call from
    dsl_pool_need_dirty_delay to txg_kick outside the section controlled
    by dp->dp_lock.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Matt Ahrens <mahrens@delphix.com>
    Signed-off-by: Jeff Dike <jdike@akamai.com>
    Closes openzfs#9094
    jdike authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    30d4c3f View commit details
    Browse the repository at this point in the history
  9. Test cancelling a removal in ZTS

    This patch adds a new test that sanity checks cancelling a removal.
    
    Reviewed-by: Matt Ahrens <mahrens@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
    Closes openzfs#9101
    Conflicts:
    	tests/zfs-tests/tests/functional/removal/Makefile.am
    sdimitro authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    2881be3 View commit details
    Browse the repository at this point in the history
  10. Don't wakeup unnecessarily in 'zpool events -f'

    ZED can prevent CPU's from properly sleeping.
    
    Rather than periodically waking up in the zevents code, just go to sleep and wait for a wakeup.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: DHE <git@dehacked.net>
    Closes openzfs#9091
    DeHackEd authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    9eaec88 View commit details
    Browse the repository at this point in the history
  11. Drop KMC_NOEMERGENCY

    This is not implemented. If it were implemented, using it would risk
    deadlocks on pre-3.18 kernels. Lets just drop it.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
    Signed-off-by: Richard Yao <ryao@gentoo.org>
    Closes openzfs#9119
    ryao authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    450c2ac View commit details
    Browse the repository at this point in the history
  12. Change boolean-like uint8_t fields in znode_t to boolean_t

    Given znode_t is an in-core structure, it's more readable to have
    them as boolean. Also co-locate existing boolean fields with them
    for space efficiency (expecting 8 booleans to be packed/aligned).
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
    Closes openzfs#9092
    Conflicts:
    	include/sys/zfs_znode.h
    	module/zfs/zfs_znode.c
    kusumi authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    e440d00 View commit details
    Browse the repository at this point in the history
  13. spa_load_verify() may consume too much memory

    When a pool is imported it will scan the pool to verify the integrity
    of the data and metadata. The amount it scans will depend on the
    import flags provided. On systems with small amounts of memory or
    when importing a pool from the crash kernel, it's possible for
    spa_load_verify to issue too many I/Os that it consumes all the memory
    of the system resulting in an OOM message or a hang.
    
    To prevent this, we limit the amount of memory that the initial pool
    scan can consume. This change will, by default, use 1/16th of the ARC
    for scan I/Os to prevent running the system out of memory during import.
    
    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
    Signed-off-by: George Wilson george.wilson@delphix.com
    External-issue: DLPX-65237
    External-issue: DLPX-65238
    Closes openzfs#9146
    grwilson authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    dde7231 View commit details
    Browse the repository at this point in the history
  14. Fix device expansion when VM is powered off

    When running on an ESXi based VM, I've found that "zpool online -e" will
    not expand the zpool, if the disk was expanded in ESXi while the VM was
    powered off.
    
    For example, take the following scenario:
    
     1. VM running on top of VMware ESXi
     2. ZFS pool created with a given device "sda" of size 8GB
     3. VM powered off
     4. Device "sda" size expanded to 16GB
     5. VM powered on
     6. "zpool online -e" used on device "sda"
    
    In this situation, after (2) the zpool will be roughly 8GB in size.
    After (6), the expectation is the zpool's size will expand to roughly
    16GB in size; i.e. expand to the new size of the "sda" device.
    Unfortunately, I've seen that after (6), the zpool size does not change.
    
    What's happening is after (5), the EFI label of the "sda" device will be
    such that fields "efi_last_u_lba", "efi_last_lba", and "efi_altern_lba"
    all reflect the new size of the disk; i.e. "33554398", "33554431", and
    "33554431" respectively.
    
    Thus, the check that we perform in "efi_use_whole_disk":
    
        if ((efi_label->efi_altern_lba == 1) || (efi_label->efi_altern_lba
            >= efi_label->efi_last_lba)) {
    
    This will return true, and then we return from the function without
    having expanded the size of the zpool/device.
    
    In contrast, if we remove steps (3) and (5) in the sequence above, i.e.
    the device is expanded while the VM is powered on, things change. In
    that case, the fields "efi_last_u_lba" and "efi_altern_lba" do not
    change (i.e. they still reflect the old 8GB device size), but the
    "efi_last_lba" field does change (i.e. it now reflects the new 16GB
    device size). Thus, when we evaluate the same conditional in
    "efi_use_whole_disk", it'll return false, so the zpool is expanded.
    
    Taking all of this into account, this PR updates "efi_use_whole_disk" to
    properly expand the zpool when the underlying disk is expanded while the
    VM is powered off.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: George Wilson <gwilson@delphix.com>
    Reviewed-by: Don Brady <don.brady@delphix.com>
    Signed-off-by: Prakash Surya <prakash.surya@delphix.com>
    Closes openzfs#9111
    Prakash Surya authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    0cc3501 View commit details
    Browse the repository at this point in the history
  15. Prevent race in blkptr_verify against device removal

    When we check the vdev of the blkptr in zfs_blkptr_verify, we can run
    into a race condition where that vdev is temporarily unavailable. This
    happens when a device removal operation and the old vdev_t has been
    removed from the array, but the new indirect vdev has not yet been
    inserted.
    
    We hold the spa_config_lock while doing our sensitive verification.
    To ensure that we don't deadlock, we only grab the lock if we don't
    have config_writer held. In addition, I had to const the tags of the
    refcounts and the spa_config_lock arguments.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
    Signed-off-by: Paul Dagnelie <pcd@delphix.com>
    Closes openzfs#9112
    pcd1193182 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    5b9b8fb View commit details
    Browse the repository at this point in the history
  16. Make txg_wait_synced conditional in zfsvfs_teardown

    The call to txg_wait_synced in zfsvfs_teardown should
    be made conditional on the objset having dirty data.
    This can prevent unnecessary txg_wait_synced during
    some unmount operations.
    
    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
    Closes openzfs#9115
    PaulZ-98 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    9bbd7fa View commit details
    Browse the repository at this point in the history
  17. Assert that a dnode's bonuslen never exceeds its recorded size

    This patch introduces an assertion that can catch pitfalls in
    development where there is a mismatch between the size of
    reads and writes between a *_phys structure and its respective
    in-core structure when bonus buffers are used.
    
    This debugging-aid should be complementary to the verification
    done by ztest in ztest_verify_dnode_bt().
    
    A side to this patch is that we now clear out any extra bytes
    past a bonus buffer's new size when the buffer is shrinking.
    
    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Tom Caputi <tcaputi@datto.com>
    Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
    Closes openzfs#8348
    sdimitro authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    086204d View commit details
    Browse the repository at this point in the history
  18. Improve write performance by using dmu_read_by_dnode()

    In zfs_log_write(), we can use dmu_read_by_dnode() rather than
    dmu_read() thus avoiding unnecessary dnode_hold() calls.
    
    We get a 2-5% performance gain for large sequential_writes tests, >=128K
    writes to files with recordsize=8K.
    
    Testing done on Ubuntu 18.04 with 4.15 kernel, 8vCPUs and SSD storage on
    VMware ESX.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Tony Nguyen <tony.nguyen@delphix.com>
    Closes openzfs#9156
    tonynguien authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    f546fe1 View commit details
    Browse the repository at this point in the history
  19. dmu_tx_wait() hang likely due to cv_signal() in dsl_pool_dirty_delta()

    Even though the bug's writeup (Github issue openzfs#9136) is very detailed,
    we still don't know exactly how we got to that state, thus I wasn't
    able to reproduce the bug. That said, we can make an educated guess
    combining the information on filled issue with the code.
    
    From the fact that `dp_dirty_total` was 0 (which is less than
    `zfs_dirty_data_max`) we know that there was one thread that set it to
    0 and then signaled one of the waiters of `dp_spaceavail_cv` [see
    `dsl_pool_dirty_delta()` which is also the only place that
    `dp_dirty_total` is changed].  Thus, the only logical explaination
    then for the bug being hit is that the waiter that just got awaken
    didn't go through `dsl_pool_dirty_data()`. Given that this function
    is only called by `dsl_pool_dirty_space()` or `dsl_pool_undirty_space()`
    I can only think of two possible ways of the above scenario happening:
    
    [1] The waiter didn't call into any of the two functions - which I
        find highly unlikely (i.e. why wait on `dp_spaceavail_cv` to begin
        with?).
    [2] The waiter did call in one of the above function but it passed 0 as
        the space/delta to be dirtied (or undirtied) and then the callee
        returned immediately (e.g both `dsl_pool_dirty_space()` and
        `dsl_pool_undirty_space()` return immediately when space is 0).
    
    In any case and no matter how we got there, the easy fix would be to
    just broadcast to all waiters whenever `dp_dirty_total` hits 0. That
    said and given that we've never hit this before, it would make sense
    to think more on why the above situation occured.
    
    Attempting to mimic what Prakash was doing in the issue filed, I
    created a dataset with `sync=always` and started doing contiguous
    writes in a file within that dataset. I observed with DTrace that even
    though we update the pool's dirty data accounting when we would dirty
    stuff, the accounting wouldn't be decremented incrementally as we were
    done with the ZIOs of those writes (the reason being that
    `dbuf_write_physdone()` isn't be called as we go through the override
    code paths, and thus `dsl_pool_undirty_space()` is never called). As a
    result we'd have to wait until we get to `dsl_pool_sync()` where we
    zero out all dirty data accounting for the pool and the current TXG's
    metadata.
    
    In addition, as Matt noted and I later verified, the same issue would
    arise when using dedup.
    
    In both cases (sync & dedup) we shouldn't have to wait until
    `dsl_pool_sync()` zeros out the accounting data. According to the
    comment in that part of the code, the reasons why we do the zeroing,
    have nothing to do with what we observe:
    ````
    /*
     * We have written all of the accounted dirty data, so our
     * dp_space_towrite should now be zero.  However, some seldom-used
     * code paths do not adhere to this (e.g. dbuf_undirty(), also
     * rounding error in dbuf_write_physdone).
     * Shore up the accounting of any dirtied space now.
     */
    dsl_pool_undirty_space(dp, dp->dp_dirty_pertxg[txg & TXG_MASK], txg);
    ````
    
    Ideally what we want to do is to undirty in the accounting exactly what
    we dirty (I use the word ideally as we can still have rounding errors).
    This would make the behavior of the system more clear and predictable.
    
    Another interesting issue that I observed with DTrace was that we
    wouldn't update any of the pool's dirty data accounting whenever we
    would dirty and/or undirty MOS data. In addition, every time we would
    change the size of a dbuf through `dbuf_new_size()` we wouldn't update
    the accounted space dirtied in the appropriate dirty record, so when
    ZIOs are done we would undirty less that we dirtied from the pool's
    accounting point of view.
    
    For the first two issues observed (sync & dedup) this patch ensures
    that we still update the pool's accounting when we undirty data,
    regardless of the write being physical or not.
    
    For changes in the MOS, we first ensure to zero out the pool's dirty
    data accounting in `dsl_pool_sync()` after we synced the MOS. Then we
    can go ahead and enable the update of the pool's dirty data accounting
    wheneve we change MOS data.
    
    Another fix is that we now update the accounting explicitly for
    counting errors in `dbuf_write_done()`.
    
    Finally, `dbuf_new_size()` updates the accounted space of the
    appropriate dirty record correctly now.
    
    The problem is that we still don't know how the bug came up in the
    issue filled. That said the issues fixed seem to be very relevant, so
    instead of going with the broadcasting solution right away,
    I decided to leave this patch as is.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
    Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
    External-issue: DLPX-47285
    Closes openzfs#9137
    sdimitro authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    addec6e View commit details
    Browse the repository at this point in the history
  20. initramfs: fixes for (debian) initramfs

    * contrib/initramfs: include /etc/default/zfs and /etc/zfs/zfs-functions
    At least debian needs /etc/default/zfs and /etc/zfs/zfs-functions for
    its initramfs. Include both in build when initramfs is configured.
    
    * contrib/initramfs: include 60-zvol.rules and zvol_id
    Include 60-zvol.rules and zvol_id and set udev as predependency instead
    of debians zdev. This makes debians additional zdev hook unneeded.
    
    * Correct initconfdir substitution for some distros
    Not every Linux distro is using @sysconfdir@/default but @initconfdir@
    which is already determined by configure. Let's use it.
    
    * systemd: prevent possible conflict between systemd and sysvinit
    Systemd will not load a sysvinit service if a unit exists with the same
    name. This prevents conflicts between sysvinit and systemd.
    In ZFS there is one sysvinit service that does not have a systemd
    service but a target counterpart, zfs-import.target.
    Usually it does not make any sense to install both but it is possisble.
    Let's prevent any conflict by masking zfs-import.service by default.
    This does not harm even if init.d/zfs-import does not exist.
    
    Reviewed-by: Chris Wedgwood <cw@f00f.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Tested-by: Alex Ingram <reimu@reimuhakurei.net>
    Tested-by: Dreamcat4 <dreamcat4@gmail.com>
    Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
    Closes openzfs#7904
    Closes openzfs#9089
    c0d3z3r0 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    b3714cd View commit details
    Browse the repository at this point in the history
  21. Add more refquota tests

    It used to be possible for zfs receive (and other operations related
    to clone swap) to bypass refquotas. This can cause a number of issues,
    and there should be an automated test for it.
    
    Added tests for rollback and receive not overriding refquota.
    
    Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Paul Dagnelie <pcd@delphix.com>
    Closes openzfs#9139
    pcd1193182 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    1a0b849 View commit details
    Browse the repository at this point in the history
  22. Set "none" scheduler if available (initramfs)

    Existing zfs initramfs script logic will attempt to set the 'noop'
    scheduler if it's available on the vdev block devices. Newer kernels
    have the similar 'none' scheduler on multiqueue devices; this change
    alters the initramfs script logic to also attempt to set this scheduler
    if it's available.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Garrett Fields <ghfields@gmail.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Signed-off-by: Colm Buckley <colm@tuatha.org>
    Closes openzfs#9042
    colmbuckley authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    e6f9948 View commit details
    Browse the repository at this point in the history
  23. Fix lockdep circular locking false positive involving sa_lock

    There are two different deadlock scenarios, but they share a common
    link, which is
    thread 1 holding sa_lock and trying to get zap->zap_rwlock:
        zap_lockdir_impl+0x858/0x16c0 [zfs]
        zap_lockdir+0xd2/0x100 [zfs]
        zap_lookup_norm+0x7f/0x100 [zfs]
        zap_lookup+0x12/0x20 [zfs]
        sa_setup+0x902/0x1380 [zfs]
        zfsvfs_init+0x3d6/0xb20 [zfs]
        zfsvfs_create+0x5dd/0x900 [zfs]
        zfs_domount+0xa3/0xe20 [zfs]
    
    and thread 2 trying to get sa_lock, either in sa_setup:
       sa_setup+0x742/0x1380 [zfs]
       zfsvfs_init+0x3d6/0xb20 [zfs]
       zfsvfs_create+0x5dd/0x900 [zfs]
       zfs_domount+0xa3/0xe20 [zfs]
    or in sa_build_index:
       sa_build_index+0x13d/0x790 [zfs]
       sa_handle_get_from_db+0x368/0x500 [zfs]
       zfs_znode_sa_init.isra.0+0x24b/0x330 [zfs]
       zfs_znode_alloc+0x3da/0x1a40 [zfs]
       zfs_zget+0x39a/0x6e0 [zfs]
       zfs_root+0x101/0x160 [zfs]
       zfs_domount+0x91f/0xea0 [zfs]
    
    From there, there are different locking paths back to something
    holding zap->zap_rwlock.
    
    The deadlock scenarios involve multiple different ZFS filesystems
    being mounted.  sa_lock is common to these scenarios, and the sa
    struct involved is private to a mount.  Therefore, these must be
    referring to different sa_lock instances and these deadlocks can't
    occur in practice.
    
    The fix, from Brian Behlendorf, is to remove sa_lock from lockdep
    coverage by initializing it with MUTEX_NOLOCKDEP.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Jeff Dike <jdike@akamai.com>
    Closes openzfs#9110
    jdike authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    55205ca View commit details
    Browse the repository at this point in the history
  24. zfs-functions.in: in_mtab() always returns 1

    $fs used with the wrong sed command where should be $mntpnt instead
    to match a variable exported by read_mtab()
    
    The fix is mostly to reuse the sed command found in read_mtab()
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
    Signed-off-by: Alexey Smirnoff <fling@member.fsf.org>
    Closes openzfs#9168
    fling- authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    7076958 View commit details
    Browse the repository at this point in the history
  25. Minor cleanup in Makefile.am

    Split long lines where adding license info to dist archive.
    
    Remove extra colon from target line.
    
    Reviewed-by: Chris Dunlop <chris@onthe.net.au>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9189
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    dca5ee7 View commit details
    Browse the repository at this point in the history
  26. ZTS: Fix vdev_zaps_005_pos on CentOS 6

    The ancient version of blkid (v2.17.2) used in CentOS 6 will not
    detect the newly created pool unless it has been written to.
    Force a pool sync so `zpool import` will detect the newly created
    pool.
    
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9199
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    3c4e1df View commit details
    Browse the repository at this point in the history
  27. Enhance ioctl number checks

    When checking ZFS_IOC_* numbers, print which numbers are wrong rather
    than silently failing.
    
    Reviewed-by: Chris Dunlop <chris@onthe.net.au>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9187
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    86dbc24 View commit details
    Browse the repository at this point in the history
  28. Dedup IOC enum values in libzfs_input_check

    Reuse enum value ZFS_IOC_BASE for `('Z' << 8)`.
    This is helpful on FreeBSD where ZFS_IOC_BASE has a different value and
    `('Z' << 8)` is wrong.
    
    Reviewed-by: Chris Dunlop <chris@onthe.net.au>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9188
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    84c96ae View commit details
    Browse the repository at this point in the history
  29. Document ZFS_DKMS_ENABLE_DEBUGINFO in userland configuration

    Document the ZFS_DKMS_ENABLE_DEBUGINFO option in the userland
    configuration file, as done with the other ZFS_DKMS_* options.
    
    It has been introduced with commit e45c173 ("dkms: Enable
    debuginfo option to be set with zfs sysconfig file") but isn't
    mentioned anywhere other than the 'dkms.conf' file (generated).
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
    Closes openzfs#9191
    mfoliveira authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    3569769 View commit details
    Browse the repository at this point in the history
  30. Fix install error introduced by openzfs#9089

    Signed-off-by: Paul Dagnelie <pcd@delphix.com>
    pcd1193182 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    0af3a0a View commit details
    Browse the repository at this point in the history
  31. ZTS: Fix in-tree dbufstats test case

    Commit a887d65 updated the dbufstats such that escalated privileges
    are required.  Since all tests under cli_user are run with normal
    privileges move this test case to a location where it will be run
    required privileges.
    
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9118
    Closes openzfs#9196
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    30ab789 View commit details
    Browse the repository at this point in the history
  32. Split argument list, satisfy shellcheck SC2086

    Split the arguments for ${TEST_RUNNER} across multiple lines for
    clarity. Also added quotes in the message to match the invoked command.
    
    Unquoted variables in argument lists are subject to splitting. In this
    particular case we can't quote the variable because it is an optional
    argument. Use the method suggested in the description linked below,
    instead.
    
    The technique is to use an unquoted variable with an alternate value.
    
    https://github.com/koalaman/shellcheck/wiki/SC2086
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9212
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    1232cbd View commit details
    Browse the repository at this point in the history
  33. Add regression test for "zpool list -p"

    Other than this test, zpool list -p is not well tested by any of the
    automated tests.  Add a test for zpool list -p.
    
    Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
    Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Paul Dagnelie <pcd@delphix.com>
    Closes openzfs#9134
    pcd1193182 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    20213e6 View commit details
    Browse the repository at this point in the history
  34. Prefer for (;;) to while (TRUE)

    Defining a special constant to make an infinite loop is excessive,
    especially when the name clashes with symbols commonly defined on
    some platforms (ie FreeBSD).
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: George Melikov <mail@gmelikov.ru>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9219
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    44fa089 View commit details
    Browse the repository at this point in the history
  35. Use smaller default slack/delta value for schedule_hrtimeout_range()

    For interrupt coalescing, cv_timedwait_hires() uses a 100us slack/delta
    for calls to schedule_hrtimeout_range(). This 100us slack can be costly
    for small writes.
    
    This change improves small write performance by passing resolution `res`
    parameter to schedule_hrtimeout_range() to be used as delta/slack. A new
    tunable `spl_schedule_hrtimeout_slack_us` is added to preserve old
    behavior when desired.
    
    Performance observations on 8K recordsize filesystem:
    - 8K random writes at 1-64 threads, up to 60% improvement for one thread
      and smaller gains as thread count increases. At >64 threads, 2-5%
      decrease in performance was observed.
    - 8K sequential writes, similar 60% improvement for one thread and
      leveling out around 64 threads. At >64 threads, 5-10% decrease in
      performance was observed.
    - 128K sequential write sees 1-5 for the 128K. No observed regression at
      high thread count.
    
    Testing done on Ubuntu 18.04 with 4.15 kernel, 8vCPUs and SSD storage on
    VMware ESX.
    
    Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Matt Ahrens <mahrens@delphix.com>
    Signed-off-by: Tony Nguyen <tony.nguyen@delphix.com>
    Closes openzfs#9217
    tonynguien authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    a8a23a1 View commit details
    Browse the repository at this point in the history
  36. Use compatible arg order in tests

    BSD getopt() and getopt_long() want options before arguments.
    Reorder arguments to zfs/zpool in tests to put all the options first.
    
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9228
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    06000ce View commit details
    Browse the repository at this point in the history
  37. Simplify deleting partitions in libtest

    Eliminate unnecessary code duplication. We can use a for-loop instead
    of a while-loop. There is no need to echo $DISKSARRAY in a subshell or
    return 0. Declare all variables with typeset.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9224
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    d962046 View commit details
    Browse the repository at this point in the history
  38. Prevent metaslab_sync panic due to spa_final_dirty_txg

    If a pool enables the SPACEMAP_HISTOGRAM feature shortly before being
    exported, we can enter a situation that causes a kernel panic. Any metaslabs
    that are loaded during the final dirty txg and haven't already been condensed
    will cause metaslab_sync to proceed after the final dirty txg so that the
    condense can be performed, which there are assertions to prevent. Because of
    the nature of this issue, there are a number of ways we can enter this
    state. Rather than try to prevent each of them one by one, potentially missing
    some edge cases, we instead cut it off at the point of intersection; by
    preventing metaslab_sync from proceeding if it would only do so to perform a
    condense and we're past the final dirty txg, we preserve the utility of the
    existing asserts while preventing this particular issue.
    
    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Paul Dagnelie <pcd@delphix.com>
    Closes openzfs#9185
    Closes openzfs#9186
    Closes openzfs#9231
    Closes openzfs#9253
    pcd1193182 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    f187167 View commit details
    Browse the repository at this point in the history
  39. Fix refquota_007_neg.ksh

    Must use 'zfs' instead of '$ZFS' which is undefined.
    
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Igor Kozhukhov <igor@dilos.org>
    Closes openzfs#9257
    ikozhukhov authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    eaa2c56 View commit details
    Browse the repository at this point in the history
  40. Fix typos in config/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9232
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    7236378 View commit details
    Browse the repository at this point in the history
  41. Fix typos in man/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9233
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    9539c54 View commit details
    Browse the repository at this point in the history
  42. Fix typos in cmd/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9234
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    623efe8 View commit details
    Browse the repository at this point in the history
  43. Fix typos in contrib/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9235
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    b893d3d View commit details
    Browse the repository at this point in the history
  44. Fix typos in etc/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9236
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    f17e686 View commit details
    Browse the repository at this point in the history
  45. Fix typos in include/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9238
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    86e39e5 View commit details
    Browse the repository at this point in the history
  46. Fix typos in modules/icp/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9239
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    62e2fa2 View commit details
    Browse the repository at this point in the history
  47. Fix typos in module/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9241
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    b4f1f80 View commit details
    Browse the repository at this point in the history
  48. Fix typos in tests/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    9049c64 View commit details
    Browse the repository at this point in the history
  49. Fix typos in tests/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9248
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    5b55ca1 View commit details
    Browse the repository at this point in the history
  50. Fix typos in lib/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9237
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    d3dfad5 View commit details
    Browse the repository at this point in the history
  51. Fix typos in module/zfs/

    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9240
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    1259fe6 View commit details
    Browse the repository at this point in the history
  52. Fix typos in tests/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9242
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    6c7aa9f View commit details
    Browse the repository at this point in the history
  53. Fix typos in tests/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9243
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    4f0c337 View commit details
    Browse the repository at this point in the history
  54. Fix typos in tests/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9244
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    575d45d View commit details
    Browse the repository at this point in the history
  55. Fix typos in tests/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9246
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    a0267fc View commit details
    Browse the repository at this point in the history
  56. Fix typos in tests/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9247
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    682d095 View commit details
    Browse the repository at this point in the history
  57. Fix typos in tests/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9249
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    e01cf9b View commit details
    Browse the repository at this point in the history
  58. Fix typos in tests/

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9250
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    8ec5be3 View commit details
    Browse the repository at this point in the history
  59. Fix typos

    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
    Closes openzfs#9251
    Gelma authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    74ec792 View commit details
    Browse the repository at this point in the history
  60. maxinflight can overflow in spa_load_verify_cb()

    When running on larger memory systems, we can overflow the value of
    maxinflight. This can result in maxinflight having a value of 0 causing
    the system to hang.
    
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: George Wilson <george.wilson@delphix.com>
    Closes openzfs#9272
    grwilson authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    92c4bc0 View commit details
    Browse the repository at this point in the history
  61. ZTS: Fix removal_cancel.ksh

    Create a larger file to extend the time required to perform the
    removal.  Occasional failures were observed due to the removal
    completing before the cancel could be requested.
    
    Reviewed-by: George Melikov <mail@gmelikov.ru>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Igor Kozhukhov <igor@dilos.org>
    Closes openzfs#9259
    ikozhukhov authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    7adf9ee View commit details
    Browse the repository at this point in the history
  62. Fix panic on DilOS with kstat per dataset statistics

    Account for ZFS_MAX_DATASET_NAME_LEN in kstat data size.  This value
    is ignored in the Linux kstat code but resolves the issue for other
    platforms.
    
    Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Igor Kozhukhov <igor@dilos.org>
    Closes openzfs#9254
    Closes openzfs#9151
    ikozhukhov authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    80caf3f View commit details
    Browse the repository at this point in the history
  63. Use the right booleans

    TRUE and FALSE happen to be defined, but we should use B_TRUE and
    B_FALSE for the sake of consistency.
    
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: George Melikov <mail@gmelikov.ru>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9264
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    ea5f806 View commit details
    Browse the repository at this point in the history
  64. Refactor checksum operations in tests

    md5sum in particular but also sha256sum to a lesser extent is used
    in several areas of the test suite for computing checksums. The vast
    majority of invocations are followed by `| awk '{ print $1 }'`.
    
    Introduce functions to wrap up `md5sum $file | awk '{ print $1 }'` and
    likewise for sha256sum. These also serve as a convenient interface for
    alternative implementations on other platforms.
    
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9280
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    a503fb8 View commit details
    Browse the repository at this point in the history
  65. Clean up zfs_clone_010_pos

    Remove a lot of unnecessary setting and incrementing of `i`.
    
    Remove unused variable `j`.
    
    Instead of calling out to Python in a loop to generate the same string
    repeatedly, generate the string once using shell constructs before
    entering the loop.
    
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9284
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    563b5fb View commit details
    Browse the repository at this point in the history
  66. Fix noop receive of raw send stream

    Currently, the noop receive code fails to work with raw send streams
    and resuming send streams. This happens because zfs_receive_impl()
    reads the DRR_BEGIN payload without reading the payload itself.
    Normally, the kernel expects to read this itself, but in this case
    the recv_skip() code runs instead and it is not prepared to handle
    the stream being left at any place other than the beginning of a
    record.
    
    This patch resolves this issue by manually reading the DRR_BEGIN
    payload in the dry-run case. This patch also includes a number of
    small fixups in this code path.
    
    Reviewed-by: George Melikov <mail@gmelikov.ru>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Paul Dagnelie <pcd@delphix.com>
    Signed-off-by: Tom Caputi <tcaputi@datto.com>
    Closes openzfs#9221
    Closes openzfs#9173
    Tom Caputi authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    186abea View commit details
    Browse the repository at this point in the history
  67. Clean up do_vol_test in zfs_copies tests

    Get rid of the `get_used_prop` function. `get_prop used` works fine.
    
    Fix the comment describing the function parameters. The type does not
    have a default, and mntp is also used for ext2.
    
    Rename the variable for the number of copies from `copy` to `copies`.
    
    Use a `case` statement to match the type parameter, order the cases
    alphabetically, and add a little sanity checking for good measure.
    
    Use eval to make sure the output of commands is silenced rather than
    the log messages when redirecting output to /dev/null.
    
    Simplify cases where zfs requires special behavior.
    
    Don't allow the test to loop forever in the event space usage does not
    change. Bail out of the loop and fail after an arbitrary number of
    iterations.
    
    Add more information to the log message when the test fails, to help
    debugging.
    
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9286
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    842e387 View commit details
    Browse the repository at this point in the history
  68. ZTS: Introduce targeted corruption in file blocks

    filetest_001_pos verifies that various checksum algorithms detect
    corruption by overwriting the underlying vdev on which a file resides.
    It is possible for the overwrite to miss the blocks of a file, causing a
    spurious failure. This change introduces a function to corrupt the
    individual blocks of a file as determined by zdb.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Signed-off-by: John Kennedy <john.kennedy@delphix.com>
    Closes openzfs#9288
    jwk404 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    546e443 View commit details
    Browse the repository at this point in the history
  69. Fix stalled txg with repeated noop scans

    Currently, the DSL scan code figures out when it should suspend
    processing and allow a txg to continue by calling the function
    dsl_scan_check_suspend(). Unfortunately, this function only
    allows the scan to suspend at a level 0 block. In the event that
    the system is scanning a bunch of empty snapshots or a resilver
    is running with a high enough scn_cur_min_txg, the scan will
    stop processing each dataset at the root level, deciding it
    has nothing left to do. This means that the check_suspend
    function is never called and the txg remains stuck until a
    dataset is found that has data to scan.
    
    This patch fixes the problem by allowing scans to suspend at
    the root level of the objset. For backwards compatibility, we
    use the bookmark <objsetid, 0, 0, 0> when we suspend here so
    that older versions of the code will work as intended.
    
    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Tom Caputi <tcaputi@datto.com>
    Closes openzfs#9300
    Tom Caputi authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    91e1543 View commit details
    Browse the repository at this point in the history
  70. Canonicalize Python shebangs

    /usr/bin/env python3 is the suggested[1] shebang for Python in general
    (likewise for python2) and is conventional across platforms. This eases
    development on systems where python is not installed in /usr/bin
    (FreeBSD for example) and makes it possible to develop in virtual
    environments (venv) for isolating dependencies.
    
    Many packaging guidelines discourage the use of /usr/bin/env, but since
    this is the canonical way of writing shebangs in the Python community,
    many packaging scripts are already equipped to handle substituting the
    appropriate absolute path to python automatically.
    
    Some RPM package builders lacking brp-mangle-shebangs need a small
    fallback mechanism in the package spec to stamp the appropriate shebang
    on installed Python scripts.
    
    [1]: https://docs.python.org/3/using/unix.html?#miscellaneous
    
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: George Melikov <mail@gmelikov.ru>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9314
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    76063fc View commit details
    Browse the repository at this point in the history
  71. Fix clone handling with encryption roots

    Currently, spa_keystore_change_key_sync_impl() does not recurse
    into clones when updating encryption roots for either a call to
    'zfs promote' or 'zfs change-key'. This can cause children of
    these clones to end up in a state where they point to the wrong
    dataset as the encryption root. It can also trigger ASSERTs in
    some cases where the code checks reference counts on wrapping
    keys. This patch fixes this issue by ensuring that this function
    properly recurses into clones during processing.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Alek Pinchuk <apinchuk@datto.com>
    Signed-off-by: Tom Caputi <tcaputi@datto.com>
    Closes openzfs#9267
    Closes openzfs#9294
    Tom Caputi authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    b58a354 View commit details
    Browse the repository at this point in the history
  72. ZTS: Fix /usr/bin/env: 'python2': No such file or directory

    Since 4f342e4 env(1) must be able to find a "python2" executable in
    the "constrained path" on systems configured with --with-python=2.x
    otherwise the ZFS Test Suite won't be able to use Python scripts.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
    Closes openzfs#9325
    loli10K authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    3ee9480 View commit details
    Browse the repository at this point in the history
  73. Device removal of indirect vdev panics the kernel

    This commit fixes a NULL pointer dereference triggered in
    spa_vdev_remove_top_check() by trying to "zpool remove" an indirect
    vdev.
    
    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
    Closes openzfs#9327
    loli10K authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    432c508 View commit details
    Browse the repository at this point in the history
  74. Refactor libzfs_error_init newlines

    Move the trailing newlines from the error message strings to the format
    strings to more closely match the other error messages.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: George Melikov <mail@gmelikov.ru>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9330
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    8dd0c4c View commit details
    Browse the repository at this point in the history
  75. Use signed types to prevent subtraction overflow

    The difference between the sizes could be positive or negative. Leaving
    the types as unsigned means the result overflows when the difference is
    negative and removing the labs() means we'll have introduced a bug. The
    subtraction results in the correct value when the unsigned integer is
    interpreted as a signed integer by labs().
    
    Clang doesn't see that we're doing a subtraction and abusing the types.
    It sees the result of the subtraction, an unsigned value, being passed
    to an absolute value function and emits a warning which we treat as an
    error.
    
    Reviewed by: Youzhong Yang <youzhong@gmail.com>
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
    Closes openzfs#9355
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    49f7f24 View commit details
    Browse the repository at this point in the history
  76. diff_cb() does not handle large dnodes

    Trying to 'zfs diff' a snapshot with large dnodes will incorrectly try
    to access its interior slots when dnodesize > sizeof(dnode_phys_t).
    This is normally not an issue because the interior slots are
    zero-filled, which report_dnode() handles calling
    report_free_dnode_range(). However this is not the case for encrypted
    large dnodes or filesystem using many SA based xattrs where the extra
    data past the legacy dnode size boundary is interpreted as a
    dnode_phys_t.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Tom Caputi <tcaputi@datto.com>
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
    Closes openzfs#7678
    Closes openzfs#8931
    Closes openzfs#9343
    loli10K authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    484a9d4 View commit details
    Browse the repository at this point in the history
  77. Add warning for zfs_vdev_elevator option removal

    Originally the zfs_vdev_elevator module option was added as a
    convenience so the requested elevator would be automatically set
    on the underlying block devices.  At the time this was simple
    because the kernel provided an API function which did exactly this.
    
    This API was then removed in the Linux 4.12 kernel which prompted
    us to add compatibly code to set the elevator via a usermodehelper.
    While well intentioned this introduced a bug which could cause a
    system hang, that issue was subsequently fixed by commit 2a0d418.
    
    In order to avoid future bugs in this area, and to simplify the code,
    this functionality is being deprecated.  A console warning has been
    added to notify any existing consumers and the documentation updated
    accordingly.  This option will remain for the lifetime of the 0.8.x
    series for compatibility but if planned to be phased out of master.
    
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Issue openzfs#8664
    Closes openzfs#9317
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    37bf226 View commit details
    Browse the repository at this point in the history
  78. ZTS: harden xattr/cleanup.ksh

    When the xattr/cleanup.ksh script is unable to remove the test group
    due to an active process then it will not call default_cleanup.  This
    will result in a zvol_ENOSPC/setup failure when attempting to create
    the /mnt/testdir directory which will already exist.
    
    Resolve the issue by performing the default_cleanup before removing
    the test user and group to ensure this step always happens.  Also
    allow one more retry to further minimize the likelihood of the
    cleanup failing.
    
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9358
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    be8749f View commit details
    Browse the repository at this point in the history
  79. Linux 5.0 compat: SIMD compatibility

    Restore the SIMD optimization for 4.19.38 LTS, 4.14.120 LTS,
    and 5.0 and newer kernels.
    
    This commit squashes the following commits from master in to
    a single commit which can be applied to 0.8.2.
    
    10fa254 - Linux 4.14, 4.19, 5.0+ compat: SIMD save/restore
    b88ca2a - Enable SIMD for encryption
    095b541 - Fix CONFIG_X86_DEBUG_FPU build failure
    e5db313 - Linux 5.0 compat: SIMD compatibility
    
    Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    TEST_ZIMPORT_SKIP="yes"
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    ed3d9f4 View commit details
    Browse the repository at this point in the history
  80. SIMD: Use alloc_pages_node to force alignment

    fxsave and xsave require the target address to be 16-/64-byte aligned.
    
    kmalloc(_node) does not (yet) offer such fine-grained control over
    alignment[0,1], even though it does "the right thing" most of the time
    for power-of-2 sizes. unfortunately, alignment is completely off when
    using certain debugging or hardening features/configs, such as KASAN,
    slub_debug=Z or the not-yet-upstream SLAB_CANARY.
    
    Use alloc_pages_node() instead which allows us to allocate page-aligned
    memory. Since fpregs_state is padded to a full page anyway, and this
    code is only relevant for x86 which has 4k pages, this approach should
    not allocate any unnecessary memory but still guarantee the needed
    alignment.
    
    0: https://lwn.net/Articles/787740/
    1: https://lore.kernel.org/linux-block/20190826111627.7505-1-vbabka@suse.cz/
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9608
    Closes openzfs#9674
    Fabian-Gruenbichler authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    be71dd1 View commit details
    Browse the repository at this point in the history
  81. Perform KABI checks in parallel

    Reduce the time required for ./configure to perform the needed
    KABI checks by allowing kbuild to compile multiple test cases in
    parallel.  This was accomplished by splitting each test's source
    code from the logic handling whether that code could be compiled
    or not.
    
    By introducing this split it's possible to minimize the number of
    times kbuild needs to be invoked.  As importantly, it means all of
    the tests can be built in parallel.  This does require a little extra
    care since we expect some tests to fail, so the --keep-going (-k)
    option must be provided otherwise some tests may not get compiled.
    Furthermore, since a failure during the kbuild modpost phase will
    result in an early exit; the final linking phase is limited to tests
    which passed the initial compilation and produced an object file.
    
    Once everything has been built the configure script proceeds as
    previously.  The only significant difference is that it now merely
    needs to test for the existence of a .ko file to determine the
    result of a given test.  This vastly speeds up the entire process.
    
    New test cases should use ZFS_LINUX_TEST_SRC to declare their test
    source code and ZFS_LINUX_TEST_RESULT to check the result.  All of
    the existing kernel-*.m4 files have been updated accordingly, see
    config/kernel-current-time.m4 for a basic example.  The legacy
    ZFS_LINUX_TRY_COMPILE macro has been kept to handle special cases
    but it's use is not encouraged.
    
                      master (secs)   patched (secs)
                      -------------   ----------------
    autogen.sh        61              68
    configure         137             24  (~17% of current run time)
    make -j $(nproc)  44              44
    make rpms         287             150
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#8547
    Closes openzfs#9132
    Closes openzfs#9341
    Conflicts:
    	Makefile.am
    	config/kernel-fpu.m4
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    f74461d View commit details
    Browse the repository at this point in the history
  82. Fix for zfs-dracut regression

    Line 31 and 32 overwrote the ${root} variable which broke mount-zfs.sh
    We have create a new variable for the dataset instead of overwriting the
    ${root} variable in zfs-load-key.sh${root} variable in zfs-load-key.sh
    
    Reviewed-by: Kash Pande <kash@tripleback.net>
    Reviewed-by: Garrett Fields <ghfields@gmail.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Dacian Reece-Stremtan <dacianstremtan@gmail.com>
    Closes openzfs#8913
    Closes openzfs#9379
    dacianstremtan authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    5656c13 View commit details
    Browse the repository at this point in the history
  83. Workaround to avoid a race when /var/lib is a persistent dataset

    If /var/lib is a dataset not under <pool>/ROOT/<root_dataset>, as
    proposed in the ubuntu root on zfs upstream guide
    (https://github.com/zfsonlinux/zfs/wiki/Ubuntu-18.04-Root-on-ZFS),
    we end up with a race where some services, like systemd-random-seed
    are writing under /var/lib, while zfs-mount is called. zfs mount will
    then potentially fail because of /var/lib isn't empty and so, can't be
    mounted.
    Order those 2 units for now (more may be needed) as we can't declare
    virtually a provide mount point to match
    "RequiresMountsFor=/var/lib/systemd/random-seed" from
    systemd-random-seed.service.
    The optional generator for zfs 0.8 fixes it, but it's not enabled
    by default nor necessarily required.
    
    Example:
    - rpool/ROOT/ubuntu (mountpoint = /)
    - rpool/var/ (mountpoint = /var)
    - rpool/var/lib  (mountpoint = /var/lib)
    
    Both zfs-mount.service and systemd-random-seed.service are starting
    After=systemd-remount-fs.service. zfs-mount.service should be done
    before local-fs.target while systemd-random-seed.service should finish
    before sysinit.target (which is a later target).
    Ideally, we would have a way for zfs mount -a unit to declare all paths
    or move systemd-random-seed after local-fs.target.
    
    Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Didier Roche <didrocks@ubuntu.com>
    Closes openzfs#9360
    didrocks authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    c1f0f26 View commit details
    Browse the repository at this point in the history
  84. ZTS: Fix upgrade_readonly_pool

    Update cleanup_upgrade to use destroy_dataset and destroy_pool
    when performing cleanup.  These wrappers retry if the pool is busy
    preventing occasional failures like those observed when running
    tests upgrade_readonly_pool.  For example:
    
        SUCCESS: test enabled == enabled
        User accounting upgrade is not executed on readonly pool
        NOTE: Performing local cleanup via log_onexit (cleanup_upgrade)
        cannot destroy 'testpool': pool is busy
        ERROR: zpool destroy testpool exited 1
    
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9400
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    1ed0d0e View commit details
    Browse the repository at this point in the history
  85. Rename rangelock_ functions to zfs_rangelock_

    A rangelock KPI already exists on FreeBSD.  Add a zfs_ prefix as
    per our convention to prevent any conflict with existing symbols.
    
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
    Closes openzfs#9402
    mattmacy authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    b386dfd View commit details
    Browse the repository at this point in the history
  86. Fix automount for root filesystems

    Commit 093bb64 resolved an automount failures for chroot'd processes
    but inadvertently broke automounting for root filesystems where the
    vfs_mntpoint is NULL.  Resolve the issue by checking for NULL in order
    to generate the correct path.
    
    Reviewed-by: Tom Caputi <tcaputi@datto.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9381
    Closes openzfs#9384
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    87a9a6f View commit details
    Browse the repository at this point in the history
  87. ZTS: Fix trim/trim_config and trim/autotrim_config

    There have been occasional CI failures which occur when the trimmed
    vdev size exactly matches the target size.  Resolve this by slightly
    relaxing the conditional and checking for -ge rather than -gt.  In
    all of the cases observer, the values match exactly.  For example:
    
        Failure /mnt/trim-vdev1 is 768 MB which is not -gt than 768 MB
    
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9399
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    97f224e View commit details
    Browse the repository at this point in the history
  88. module/Makefile.in: don't run xargs if empty

    If stdin if empty - don't run xargs command,
    otherwise we can get `cp: missing file operand`
    error.
    
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: George Melikov <mail@gmelikov.ru>
    Closes openzfs#9418
    gmelikov authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    c20b0fa View commit details
    Browse the repository at this point in the history
  89. ZTS: Fix mmp_hostid test

    Correctly use the `mntpnt_fs` variable, and include additional
    logic to ensure the /etc/hostid is correct set up and cleaned up.
    
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Igor Kozhukhov <igor@dilos.org>
    Closes openzfs#9349
    ikozhukhov authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    6e5ba87 View commit details
    Browse the repository at this point in the history
  90. Update zfs program command usage

    Update the zfs(8) man page to clearly describe that arguments for
    channel programs are to be listed after the -- sentinel which
    terminates argument processing.  This behavior is supported by
    getopt on Linux, FreeBSD, and Illumos according to each platforms
    respective man pages.
    
        zfs program [-jn] [-t instruction-limit] [-m memory-limit]
            pool script [--] arg1 ...
    
    Reviewed-by: Clint Armstrong <clint@clintarmstrong.net>
    Reviewed-by: George Melikov <mail@gmelikov.ru>
    Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9056
    Closes openzfs#9428
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    5d211cc View commit details
    Browse the repository at this point in the history
  91. Fix pool creation with feature@allocation_classes disabled

    When "feature@allocation_classes" is not enabled on the pool no vdev
    with "special" or "dedup" allocation type should be allowed to exist in
    the vdev tree.
    
    Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
    Closes openzfs#9427
    Closes openzfs#9429
    loli10K authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    1a143b2 View commit details
    Browse the repository at this point in the history
  92. Fix some style nits in tests

    Mostly whitespace changes, no functional changes intended.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Closes openzfs#9447
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    08c0b75 View commit details
    Browse the repository at this point in the history
  93. Clarify loop variable name in zfs copies test

    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Closes openzfs#9445
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    9ab63e2 View commit details
    Browse the repository at this point in the history
  94. Implement ZPOOL_IMPORT_UDEV_TIMEOUT_MS

    Since 0.7.0, zpool import would unconditionally block on udev for 30
    seconds. This introduced a regression in initramfs environments that
    lack udev (particularly mdev based environments), yet use a zfs userland
    tools intended for the system that had been built against udev. Gentoo's
    genkernel is the main example, although custom user initramfs
    environments would be similarly impacted unless special builds of the
    ZFS userland utilities were done for them.  Such environments already
    have their own mechanisms for blocking until device nodes are ready
    (such as genkernel's scandelay parameter), so it is unnecessary for
    zpool import to block on a non-existent udev until a timeout is reached
    inside of them.
    
    Rather than trying to intelligently determine whether udev is available
    on the system to avoid unnecessarily blocking in such environments, it
    seems best to just allow the environment to override the timeout.  I
    propose that we add an environment variable called
    ZPOOL_IMPORT_UDEV_TIMEOUT_MS. Setting it to 0 would restore the 0.6.x
    behavior that was more desirable in mdev based initramfs environments.
    This allows the system user land utilities to be reused when building
    mdev-based initramfs archives.
    
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Jorgen Lundman <lundman@lundman.net>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Georgy Yakovlev <gyakovlev@gentoo.org>
    Signed-off-by: Richard Yao <ryao@gentoo.org>
    Closes openzfs#9436
    ryao authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    08410c2 View commit details
    Browse the repository at this point in the history
  95. ZTS: Fix zpool_status_-s

    After commit 5e74ac5 which split and reordered the run files the
    `zpool_status_-s` test began failing.  The new ordering placed
    the test after a previous test which used `zpool replace` to replace
    a disk but did not clear its label.  This resulted in the next test,
    `zpool_status_-s`, failing because of the potentially active
    pool being detected on the replaced vdev.
    
        /dev/loop0 is part of potentially active pool 'testpool'
    
    Use the default_mirror_setup_noexit() and default_cleanup_noexit()
    functions to create the pool in `zpool_status_-s`.  They use the -f
    flag by default.
    
    In the `scrub_after_resilver` test wipe the label during cleanup
    to prevent future failures if the tests are again reordered.
    
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9451
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    5d5faa3 View commit details
    Browse the repository at this point in the history
  96. Modify sharenfs=on default behavior

    While it may sometimes be convenient to export an NFS filesystem with
    no_root_squash it should not be the default behavior.  Align the
    default behavior with the Linux NFS server defaults.  To restore
    the previous behavior use 'zfs set sharenfs="no_root_squash,..."'.
    
    Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9397
    Closes openzfs#9425
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    d2fb93b View commit details
    Browse the repository at this point in the history
  97. Update skc_obj_alloc for spl kmem caches that are backed by Linux

    Currently, for certain sizes and classes of allocations we use
    SPL caches that are backed by caches in the Linux Slab allocator
    to reduce fragmentation and increase utilization of memory. The
    way things are implemented for these caches as of now though is
    that we don't keep any statistics of the allocations that we
    make from these caches.
    
    This patch enables the tracking of allocated objects in those
    SPL caches by making the trade-off of grabbing the cache lock
    at every object allocation and free to update the respective
    counter.
    
    Additionally, this patch makes those caches visible in the
    /proc/spl/kmem/slab special file.
    
    As a side note, enabling the specific counter for those caches
    enables SDB to create a more user-friendly interface than
    /proc/spl/kmem/slab that can also cross-reference data from
    slabinfo. Here is for example the output of one of those
    caches in SDB that outputs the name of the underlying Linux
    cache, the memory of SPL objects allocated in that cache,
    and the percentage of those objects compared to all the
    objects in it:
    ```
    > spl_kmem_caches | filter obj.skc_name == "zio_buf_512" | pp
    name        ...            source total_memory util
    ----------- ... ----------------- ------------ ----
    zio_buf_512 ... kmalloc-512[SLUB]       16.9MB    8
    ```
    
    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
    Closes openzfs#9474
    sdimitro authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    6946a52 View commit details
    Browse the repository at this point in the history
  98. Name anonymous enum of KMC_BIT constants

    Giving a name to this enum makes it discoverable from
    debugging tools like DRGN and SDB. For example, with
    the name proposed on this patch we can iterate over
    these values in DRGN:
    ```
    >>> prog.type('enum kmc_bit').enumerators
    (('KMC_BIT_NOTOUCH', 0), ('KMC_BIT_NODEBUG', 1),
    ('KMC_BIT_NOMAGAZINE', 2), ('KMC_BIT_NOHASH', 3),
    ('KMC_BIT_QCACHE', 4), ('KMC_BIT_KMEM', 5),
    ('KMC_BIT_VMEM', 6), ('KMC_BIT_SLAB', 7),
    ...
    ```
    This enables SDB to easily pretty-print the flags of
    the spl_kmem_caches in the system like this:
    ```
    > spl_kmem_caches -o "name,flags,total_memory"
    name                                       flags total_memory
    ------------------------ ----------------------- ------------
    abd_t                    KMC_NOMAGAZINE|KMC_SLAB        4.5MB
    arc_buf_hdr_t_full       KMC_NOMAGAZINE|KMC_SLAB       12.3MB
    ... <cropped> ...
    ddt_cache                               KMC_VMEM      583.7KB
    ddt_entry_cache          KMC_NOMAGAZINE|KMC_SLAB         0.0B
    ... <cropped> ...
    zio_buf_1048576             KMC_NODEBUG|KMC_VMEM         0.0B
    ... <cropped> ...
    ```
    
    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
    Closes openzfs#9478
    sdimitro authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    4db8ddd View commit details
    Browse the repository at this point in the history
  99. ZTS: Written props test fails with 4k disks

    With 4k disks, this test will fail in the last section because the
    expected human readable value of 20.0M is reported as 20.1M. Rather than
    use the human readable property, switch to the parsable property and
    verify that the values are reasonably close.
    
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: John Kennedy <john.kennedy@delphix.com>
    Closes openzfs#9477
    jwk404 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    ac67de2 View commit details
    Browse the repository at this point in the history
  100. Use correct format string when printing int8

    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: George Melikov <mail@gmelikov.ru>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
    Closes openzfs#9486
    mattmacy authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    d8cd6a8 View commit details
    Browse the repository at this point in the history
  101. ZTS: Consistency pass for .ksh extensions

    * Use .ksh extension for ksh scripts, not .sh
    * Remove .ksh extension from tests in common.run
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Closes openzfs#9502
    Ryan Moeller authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    2ca4787 View commit details
    Browse the repository at this point in the history
  102. Fix incremental recursive encrypted receive

    Currently, incremental recursive encrypted receives fail to work
    for any snapshot after the first. The reason for this is because
    the check in zfs_setup_cmdline_props() did not properly realize
    that when the user attempts to use '-x encryption' in this
    situation, they are not really overriding the existing encryption
    property and instead are attempting to prevent it from changing.
    This resulted in an error message stating: "encryption property
    'encryption' cannot be set or excluded for raw or incremental
    streams".
    
    This problem is fixed by updating the logic to expect this use
    case.
    
    Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Signed-off-by: Tom Caputi <tcaputi@datto.com>
    Closes openzfs#9494
    Tom Caputi authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    27ff6fc View commit details
    Browse the repository at this point in the history
  103. Fix zpool history unbounded memory usage

    In original implementation, zpool history will read the whole history
    before printing anything, causing memory usage goes unbounded. We fix
    this by breaking it into read-print iterations.
    
    Reviewed-by: Tom Caputi <tcaputi@datto.com>
    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
    Closes openzfs#9516
    davidchenntnx authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    bb230d9 View commit details
    Browse the repository at this point in the history
  104. Fix 'zfs change-key' with unencrypted child

    Currently, when you call 'zfs change-key' on an encrypted dataset
    that has an unencrypted child, the code will trigger a VERIFY.
    This VERIFY is leftover from before we allowed unencrypted
    datasets to exist underneath encrypted ones. This patch fixes the
    issue by simply replacing the VERIFY with an early return when
    recursing through datasets.
    
    Reviewed by: Jason King <jason.brian.king@gmail.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Signed-off-by: Tom Caputi <tcaputi@datto.com>
    Closes openzfs#9524
    Tom Caputi authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    9216e78 View commit details
    Browse the repository at this point in the history
  105. Fix contrib/zcp/Makefile.am

    Remove the stray leading + from the Makefile.  This was
    preventing the autosnap.lua channel program from being
    properly included by `make dist`.
    
    Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9527
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    9ea68a8 View commit details
    Browse the repository at this point in the history
  106. dracut/zfs-load-key.sh: properly remove prefixes

    Removes the 'ZFS=' prefix from $BOOTFS instead of $root. This makes sure
    that the 'zfs:' prefix remains stripped so that users with
    'root=zfs:dataset' cmdline can have key loaded on boot again.
    
    Reviewed-by: Garrett Fields <ghfields@gmail.com>
    Reviewed-by: Dacian Reece-Stremtan <dacianstremtan@gmail.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Hiếu Lê <leorize+oss@disroot.org>
    Closes openzfs#9520
    alaviss authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    d0486fb View commit details
    Browse the repository at this point in the history
  107. Include prototypes for vdev_initialize

    Address two prototype related warnings emitted by clang.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
    Closes openzfs#9535
    mattmacy authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    fcf3a2e View commit details
    Browse the repository at this point in the history
  108. Add a notice in /etc/defaults/zfs for systemd users

    Some systemd users may want to change configurations in
    /etc/defaults/zfs, but these settings won't affect systemd
    services.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Mo Zhou <cdluminate@gmail.com>
    Closes openzfs#9544
    cdluminate authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    bf53985 View commit details
    Browse the repository at this point in the history
  109. Skip loading already loaded key

    Don't ask for the password / try to load the key if the key for the
    encryptionroot is already loaded.  The user might have loaded the key
    manually or by other means before the scripts get called.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Tom Caputi <tcaputi@datto.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Signed-off-by: Witaut Bajaryn <vitaut.bayaryn@gmail.com>
    Closes openzfs#9495
    Closes openzfs#9529
    vozhyk- authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    5077db6 View commit details
    Browse the repository at this point in the history
  110. Improve logging of 128KB writes

    Before my ZIL space optimization few years ago 128KB writes were logged
    as two 64KB+ records in two 128KB log blocks.  After that change it
    became ~127KB+/1KB+ in two 128KB log blocks to free space in the second
    block for another record.  Unfortunately in case of 128KB only writes,
    when space in the second block remained unused, that change increased
    write latency by unbalancing checksum computation and write times
    between parallel threads.  It also didn't help with SLOG space
    efficiency in that case.
    
    This change introduces new 68KB log block size, used for both writes
    below 67KB and 128KB-sharp writes.  Writes of 68-127KB are still using
    one 128KB block to not increase processing overhead.  Writes above
    131KB are still using full 128KB blocks, since possible saving there
    is small.  Mixed loads will likely also fall back to previous 128KB,
    since code uses maximum of the last 16 requested block sizes.
    
    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by:  Alexander Motin <mav@FreeBSD.org>
    Closes openzfs#9409
    amotin authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    382aeaf View commit details
    Browse the repository at this point in the history
  111. Fix zpool create -o <property> error message

    When `zpool create -o <property>` is run without root permissions
    and the pool property requested is not specifically enumerated in
    zpool_valid_proplist().  Then an incorrect error message referring
    to an invalid property is printed rather than the expected permission
    denied error.
    
    Specifying a pool property at create time should be handled the same
    way as filesystem properties in zfs_valid_proplist().  There should
    not be default zfs_error_aux() set for properties which are not
    listed.
    
    Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9550
    Closes openzfs#9568
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    c885930 View commit details
    Browse the repository at this point in the history
  112. Add missing documentation for some KMC flags

    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Matt Ahrens <matt@delphix.com>
    Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
    Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
    Closes openzfs#9034
    c0d3z3r0 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    e0ecb41 View commit details
    Browse the repository at this point in the history
  113. Prevent NULL pointer dereference in blkg_tryget() on EL8 kernels

    blkg_tryget() as shipped in EL8 kernels does not seem to handle NULL
    @blkg as input; this is different from its mainline counterpart where
    NULL is accepted.  To prevent dereferencing a NULL pointer when dealing
    with block devices which do not set a root_blkg on the request queue
    perform the NULL check in vdev_bio_associate_blkg().
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
    Closes openzfs#9546
    Closes openzfs#9577
    loli10K authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    2456817 View commit details
    Browse the repository at this point in the history
  114. Change zed.service to zfs-zed.service in man page

    zed.service does not exist
    replaced with correct service name in man.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
    Closes openzfs#9581
    Kjeld Schouten authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    7552de5 View commit details
    Browse the repository at this point in the history
  115. Remove inappropiate error message suggesting to use '-r'

    Removes an incorrect error message from libzfs that suggests applying
    '-r' when a zfs subcommand is called with a filesystem path while
    expecting either a snapshot or bookmark path.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
    Closes openzfs#9574
    InsanePrawn authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    58b5847 View commit details
    Browse the repository at this point in the history
  116. Break out of zfs_zget early if unlinked znode

    If zp->z_unlinked is set, we're working with a znode that has been
    marked for deletion. If that's the case, we can skip the "goto again"
    loop and return ENOENT, as the znode should not be discovered.
    
    Reviewed-by: Richard Yao <ryao@gentoo.org>
    Reviewed-by: Matt Ahrens <mahrens@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Heitor Alves de Siqueira <halves@canonical.com>
    Closes openzfs#9583
    hrasiq authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    1a4c107 View commit details
    Browse the repository at this point in the history
  117. Remove requirement for -d 1 for zfs list and zfs get with bookmarks

    df58307 removed the need to specify -d 1 when zfs list and zfs get are
    called with -t snapshot on a datset. This commit extends the same
    behaviour to -t bookmark.
    
    This commit also introduces the 'snap' shorthand for snapshots from
    zfs list to zfs get.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Tom Caputi <tcaputi@datto.com>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
    Closes openzfs#9589
    InsanePrawn authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    18b36a7 View commit details
    Browse the repository at this point in the history
  118. ZTS: Casenorm fix unicode interpretation

    Use `printf` to properly interpret unicode characters.
    
    Illumos uses a utility called `zlook` to allow additional flags to be
    provided to readdir and lookup for testing.  This functionality could
    be ported to Linux, but even without it several of the tests can be
    enabled by instead using the standard `test` command.
    
    Additional, work is required to enable the remaining test cases.
    
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: George Melikov <mail@gmelikov.ru>
    Issue openzfs#7633
    Closes openzfs#8812
    gmelikov authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    5d175b7 View commit details
    Browse the repository at this point in the history
  119. ZTS: tst.terminate_by_signal increase test threshold

    The tst.terminate_by_signal test case may occasionally fail when
    running in a less consistent virtual environment.  For all observed
    failures the process was terminated correctly but it took longer than
    expected resulting in too many snapshot being created.
    
    To minimize the likelyhood of this occuring increase the threshold
    from 50 to 90 snapshots.  The larger limit will still verifiy that
    the channel program was correctly terminated early.
    
    Reviewed-by: Don Brady <don.brady@delphix.com>
    Reviewed-by: Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9601
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    8d14009 View commit details
    Browse the repository at this point in the history
  120. Check for unlinked znodes after igrab()

    The changes in commit 41e1aa2 / PR openzfs#9583 introduced a regression on
    tmpfile_001_pos: fsetxattr() on a O_TMPFILE file descriptor started
    to fail with errno ENODATA:
    
        openat(AT_FDCWD, "/test", O_RDWR|O_TMPFILE, 0666) = 3
        <...>
        fsetxattr(3, "user.test", <...>, 64, 0) = -1 ENODATA
    
    The originally proposed change on PR openzfs#9583 is not susceptible to it,
    so just move the code/if-checks around back in that way, to fix it.
    
    Reviewed-by: Pavel Snajdr <snajpa@snajpa.net>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Original-patch-by: Heitor Alves de Siqueira <halves@canonical.com>
    Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
    Closes openzfs#9602
    mfoliveira authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    5c0fa51 View commit details
    Browse the repository at this point in the history
  121. Add display of checksums to zdb -R

    The function zdb_read_block (zdb -R) was always intended to have a :c
    flag which would read the DVA and length supplied by the user, and
    display the checksum. Since we don't know which checksum goes with
    the data, we should calculate and display them all.
    
    For each checksum in the table, read in the data at the supplied
    DVA:length, calculate the checksum, and display it. Update the man
    page and create a zfs test for the new feature.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
    Closes openzfs#9607
    PaulZ-98 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    16e496c View commit details
    Browse the repository at this point in the history
  122. Remove zfs_vdev_elevator module option

    As described in commit f81d5ef the zfs_vdev_elevator module
    option is being removed.  Users who require this functionality
    should update their systems to set the disk scheduler using a
    udev rule.
    
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Issue openzfs#8664
    Closes openzfs#9417
    Closes openzfs#9609
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    4f096ec View commit details
    Browse the repository at this point in the history
  123. Implement -A (ignore ASSERTs) for zdb

    The command line switch -A (ignore ASSERTs) has always been available
    in zdb but was never connected up to the correct global variable.
    
    There are times when you need zdb to ignore asserts and keep dumping
    out whatever information it can get despite the ASSERT(s) failing.
    It was always intended to be part of zdb but was incomplete.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
    Closes openzfs#9610
    PaulZ-98 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    5c2c1cd View commit details
    Browse the repository at this point in the history
  124. Fix small typo in systemd mount generator

    Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
    Closes openzfs#9611
    InsanePrawn authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    cbb83dd View commit details
    Browse the repository at this point in the history
  125. Fix non-absolute path in systemd mount generator

    Systemd will ignore units that try to execute programs from non-absolute
    paths. Use hardcoded /bin/sh instead.
    
    Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
    Closes openzfs#9611
    InsanePrawn authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    9f51a04 View commit details
    Browse the repository at this point in the history
  126. Fix encryption logic in systemd mount generator

    Previously the generator would skip a dataset if it wasn't mountable by
    'zfs mount -a' (legacy/none mountpoint, canmount off/noauto). This also
    skipped the generation of key-load units for such datasets, breaking
    the dependency handling for mountable child datasets.
    
    Reviewed-by: Antonio Russo <antonio.e.russo@gmail.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
    Closes openzfs#9611
    InsanePrawn authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    c8c7095 View commit details
    Browse the repository at this point in the history
  127. Adapt gitignore for modules

    Remove the specific gitignore rules for module left-overs and add a
    generic one in modules/.
    
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
    Closes openzfs#9656
    c0d3z3r0 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    03a7336 View commit details
    Browse the repository at this point in the history
  128. Increase allowed 'special_small_blocks' maximum value

    There may be circumstances where it's desirable that all blocks
    in a specified dataset be stored on the special device.  Relax
    the artificial 128K limit and allow the special_small_blocks
    property to be set up to 1M.  When blocks >1MB have been enabled
    via the zfs_max_recordsize module option, this limit is increased
    accordingly.
    
    Reviewed-by: Don Brady <don.brady@delphix.com>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9131
    Closes openzfs#9355
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    44bc323 View commit details
    Browse the repository at this point in the history
  129. Fix use-after-free in case of L2ARC prefetch failure

    In case L2ARC read failed, l2arc_read_done() creates _different_ ZIO
    to read data from the original storage device.  Unfortunately pointer
    to the failed ZIO remains in hdr->b_l1hdr.b_acb->acb_zio_head, and if
    some other read try to bump the ZIO priority, it will crash.
    
    The problem is reproducible by corrupting L2ARC content and reading
    some data with prefetch if l2arc_noprefetch tunable is changed to 0.
    With the default setting the issue is probably not reproducible now.
    
    Reviewed-by: Tom Caputi <tcaputi@datto.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Alexander Motin <mav@FreeBSD.org>
    Sponsored-By: iXsystems, Inc.
    Closes openzfs#9648
    amotin authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    f05d403 View commit details
    Browse the repository at this point in the history
  130. Fix zdb_read_block using zio after it is destroyed

    The checksum display code of zdb_read_block uses a zio
    to read in the block and then calls zio_checksum_compute.
    Use a new zio in the call to zio_checksum_compute not the zio
    from the read which has been destroyed by zio_wait.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
    Closes openzfs#9644
    Closes openzfs#9657
    PaulZ-98 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    eca8d1f View commit details
    Browse the repository at this point in the history
  131. Fix reporting of L2ARC hits/misses in arc_summary3

    arc_summary3 reports L2ARC hits and misses as Bytes, whereas they
    should be reported as events. arc_summary2 reports these correctly.
    
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: George Amanakis <gamanakis@gmail.com>
    Closes openzfs#9669
    gamanakis authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    7ec60f1 View commit details
    Browse the repository at this point in the history
  132. Set send_realloc_files.ksh to use properties.shlib

    This sets send_realloc_files.ksh to use properties.shlib
    (like the other compression related tests)
    
    It was missing from openzfs#9645
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
    Issue openzfs#9645
    Closes openzfs#9679
    Kjeld Schouten authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    8c9a572 View commit details
    Browse the repository at this point in the history
  133. ZTS: Fix zpool_reopen_001_pos

    Update the vdev_disk_open() retry logic to use a specified number
    of milliseconds to be more robust.  Additionally, on failure log
    both the time waited and requested timeout to the internal log.
    
    The default maximum allowed open retry time has been increased
    from 500ms to 1000ms.
    
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9680
    Conflicts:
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    ba9c024 View commit details
    Browse the repository at this point in the history
  134. Exclude data from cores unconditionally and metadata conditionally

    This change allows us to align the code dump logic across platforms.
    
    Reviewed-by: Jorgen Lundman <lundman@lundman.net>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Don Brady <don.brady@delphix.com>
    Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
    Closes openzfs#9691
    mattmacy authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    74dec73 View commit details
    Browse the repository at this point in the history
  135. zio_decompress_data always ASSERTs successful decompression

    This interferes with zdb_read_block trying all the decompression
    algorithms when the 'd' flag is specified, as some are
    expected to fail.  Also control the output when guessing
    algorithms, try the more common compression types first, allow
    specifying lsize/psize, and fix an uninitialized variable.
    
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Paul Zuchowski <pzuchowski@datto.com>
    Closes openzfs#9612
    Closes openzfs#9630
    PaulZ-98 authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    e26ecd4 View commit details
    Browse the repository at this point in the history
  136. Fix use-after-free of vd_path in spa_vdev_remove()

    After spa_vdev_remove_aux() is called, the config nvlist is no longer
    valid, as it's been replaced by the new one (with the specified device
    removed).  Therefore any pointers into the nvlist are no longer valid.
    So we can't save the result of
    `fnvlist_lookup_string(nv, ZPOOL_CONFIG_PATH)` (in vd_path) across the
    call to spa_vdev_remove_aux().
    
    Instead, use spa_strdup() to save a copy of the string before calling
    spa_vdev_remove_aux.
    
    Found by AddressSanitizer:
    
    ERROR: AddressSanitizer: heap-use-after-free on address ...
    READ of size 34 at 0x608000a1fcd0 thread T686
        #0 0x7fe88b0c166d  (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x5166d)
        #1 0x7fe88a5acd6e in spa_strdup spa_misc.c:1447
        #2 0x7fe88a688034 in spa_vdev_remove vdev_removal.c:2259
        #3 0x55ffbc7748f8 in ztest_vdev_aux_add_remove ztest.c:3229
        #4 0x55ffbc769fba in ztest_execute ztest.c:6714
        openzfs#5 0x55ffbc779a90 in ztest_thread ztest.c:6761
        openzfs#6 0x7fe889cbc6da in start_thread
        openzfs#7 0x7fe8899e588e in __clone
    
    0x608000a1fcd0 is located 48 bytes inside of 88-byte region
    freed by thread T686 here:
        #0 0x7fe88b14e7b8 in __interceptor_free
        #1 0x7fe88ae541c5 in nvlist_free nvpair.c:874
        #2 0x7fe88ae543ba in nvpair_free nvpair.c:844
        #3 0x7fe88ae57400 in nvlist_remove_nvpair nvpair.c:978
        #4 0x7fe88a683c81 in spa_vdev_remove_aux vdev_removal.c:185
        openzfs#5 0x7fe88a68857c in spa_vdev_remove vdev_removal.c:2221
        openzfs#6 0x55ffbc7748f8 in ztest_vdev_aux_add_remove ztest.c:3229
        openzfs#7 0x55ffbc769fba in ztest_execute ztest.c:6714
        openzfs#8 0x55ffbc779a90 in ztest_thread ztest.c:6761
        openzfs#9 0x7fe889cbc6da in start_thread
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
    Closes openzfs#9706
    ahrens authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    4ecbf33 View commit details
    Browse the repository at this point in the history
  137. Allow empty ds_props_obj to be destroyed

    Currently, 'zfs list' and 'zfs get' commands can be slow when
    working with snapshots that have a ds_props_obj. This is
    because the code that discovers all of the properties for these
    snapshots needs to read this object for each snapshot, which
    almost always ends up causing an extra random synchronous read
    for each snapshot. This performance penalty exists even if the
    properties on that snapshot have been unset because the object
    is normally only freed when the snapshot is freed, even though
    it is only created when it is needed.
    
    This patch allows the user to regain 'zfs list' performance on
    these snapshots by destroying the ds_props_obj when it no longer
    has any entries left. In practice on a production machine, this
    optimization seems to make 'zfs list' about 55% faster.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Paul Zuchowski <pzuchowski@datto.com>
    Signed-off-by: Tom Caputi <tcaputi@datto.com>
    Closes openzfs#9704
    Tom Caputi authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    fbe4bd9 View commit details
    Browse the repository at this point in the history
  138. Don't fail to apply umask for O_TMPFILE files

    Apply umask to `mode` which will eventually be applied to inode.
    This is needed since VFS doesn't apply umask for O_TMPFILE files.
    
    (Note that zpl_init_acl() applies `ip->i_mode &= ~current_umask();`
    only when POSIX ACL is used.)
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
    Closes openzfs#8997
    Closes openzfs#8998
    kusumi authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    48849e4 View commit details
    Browse the repository at this point in the history
  139. initramfs: setup keymapping and video for prompts

    From Steve Langasek <steve.langasek@canonical.com>:
    > The poorly-named 'FRAMEBUFFER' option in initramfs-tools controls
    > whether the console_setup and plymouth scripts are included and used
    > in the initramfs. These are required for any initramfs which will be
    > prompting for user input: console_setup because without it the user's
    > configured keymap will not be set up, and plymouth because you are
    > not guaranteed to have working video output in the initramfs without
    > it (e.g. some nvidia+UEFI configurations with the default GRUB
    > behavior).
    
    > The zfs initramfs script may need to prompt the user for passphrases
    > for encrypted zfs datasets, and we don't know definitively whether
    > this is the case or not at the time the initramfs is constructed (and
    > it's difficult to dynamically populate initramfs config variables
    > anyway), therefore the zfs-initramfs package should just set
    > FRAMEBUFFER=yes in a conf snippet the same way that the
    > cryptsetup-initramfs package does
    > (/usr/share/initramfs-tools/conf-hooks.d/cryptsetup).
    
    https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1856408
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Steve Langasek <steve.langasek@canonical.com>
    Signed-off-by: Richard Laager <rlaager@wiktel.com>
    Closes openzfs#9723
    rlaager authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    1420f55 View commit details
    Browse the repository at this point in the history
  140. Force systems with kernel option "quiet" to display prompt for password

    On systems that utilize TTY for password entry, if the kernel
    option "quiet" is set, the system would appear to freeze on a
    blank screen, when in fact it is waiting for password entry
    from the user.
    
    Since TTY is the fallback method, this has no effect on systemd
    or plymouth password prompting.
    
    By temporarily setting "printk" to "7", running the command,
    then resuming with the original "printk" state, the user can
    see the password prompt.
    
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Garrett Fields <ghfields@gmail.com>
    Closes openzfs#9731
    ghfields authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    d61ee3e View commit details
    Browse the repository at this point in the history
  141. Create symbolic links in /dev/disk/by-vdev for nvme disk devices

    The existing rules miss nvme disk devices because of the trailing
    digits in the KERNEL device name, e.g. nvme0n1. Partitions of nvme
    disk devices are already properly handled by the existing rule for
    ENV{DEVTYPE}=="partition".
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Thomas Geppert <geppi@digitx.de>
    Closes openzfs#9730
    geppi authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    d37bea0 View commit details
    Browse the repository at this point in the history
  142. Exchanged two "${ZFS} get -H -o value" commands

    Initramfs uses "get_fs_value()" elsewhere.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
    Signed-off-by: Garrett Fields <ghfields@gmail.com>
    Closes openzfs#9736
    ghfields authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    8341b1c View commit details
    Browse the repository at this point in the history
  143. cppcheck: (error) Uninitialized variable

    Resolve the following uninitialized variable warnings.  In practice
    these were unreachable due to the goto.  Replacing the goto with a
    return resolves the warning and yields more readable code.
    
    [module/icp/algs/modes/ccm.c:892]: (error) Uninitialized variable: ccm_param
    [module/icp/algs/modes/ccm.c:893]: (error) Uninitialized variable: ccm_param
    [module/icp/algs/modes/gcm.c:564]: (error) Uninitialized variable: gcm_param
    [module/icp/algs/modes/gcm.c:565]: (error) Uninitialized variable: gcm_param
    [module/icp/algs/modes/gcm.c:599]: (error) Uninitialized variable: gmac_param
    [module/icp/algs/modes/gcm.c:600]: (error) Uninitialized variable: gmac_param
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9732
    Ubuntu authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    564cb85 View commit details
    Browse the repository at this point in the history
  144. cppcheck: (error) Uninitialized variable

    As of cppcheck 1.82 warnings are issued when using the list_for_each_*
    functions with an uninitialized variable.  Functionally, this is fine
    but to resolve the warning initialize these variables.
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9732
    Ubuntu authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    b76be31 View commit details
    Browse the repository at this point in the history
  145. cppcheck: (error) Shifting signed 64-bit value by 63 bits

    As of cppcheck 1.82 surpress the warning regarding shifting too many
    bits for __divdi3() implemention.  The algorithm used here is correct.
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9732
    Ubuntu authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    35e157c View commit details
    Browse the repository at this point in the history
  146. cppcheck: (error) Memory leak: vtoc

    Resolve the reported memory leak by using a dedicated local vptr
    variable to store the pointer reported by calloc().  Only assign the
    passed **vtoc function argument on success, in all other cases vptr
    is freed.
    
    [lib/libefi/rdwr_efi.c:403]: (error) Memory leak: vtoc
    [lib/libefi/rdwr_efi.c:422]: (error) Memory leak: vtoc
    [lib/libefi/rdwr_efi.c:440]: (error) Memory leak: vtoc
    [lib/libefi/rdwr_efi.c:454]: (error) Memory leak: vtoc
    [lib/libefi/rdwr_efi.c:470]: (error) Memory leak: vtoc
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9732
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    0c3c858 View commit details
    Browse the repository at this point in the history
  147. cppcheck: (warning) Possible null pointer dereference: dnp

    The dnp argument can only be set to NULL when the DNODE_DRY_RUN flag
    is set.  In which case, an early return path will be executed and a
    NULL pointer dereference at the given location is impossible.  Add
    an additional ASSERT to silence the cppcheck warning and document
    that dbp must never be NULL at the point in the function.
    
    [module/zfs/dnode.c:1566]: (warning) Possible null pointer deref: dnp
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9732
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    8b6657c View commit details
    Browse the repository at this point in the history
  148. cppcheck: (error) Null pointer dereference: who_perm

    As indicated by the VERIFY the local who_perm variable can never
    be NULL in parse_fs_perm().  Due to the existence of the is_set
    conditional, which is always true, cppcheck 1.88 was reporting
    a possible NULL reference.  Resolve the issue by removing the
    extraneous is_set variable.
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9732
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    5a9ab4b View commit details
    Browse the repository at this point in the history
  149. cppcheck: (error) Address of local auto-variable assigned

    Suppress autoVariables warnings in the lua interpreter.  The usage
    here while unconventional in intentional and the same as upstream.
    
    [module/lua/ldebug.c:327]: (error) Address of local auto-variable
        assigned to a function parameter.
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9732
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    6154c07 View commit details
    Browse the repository at this point in the history
  150. cppcheck: (warning) Possible null pointer dereference: nvh

    Move the 'nvh = (void *)buf' assignment after the 'buf == NULL'
    check to resolve the warning.  Interestingly, cppcheck 1.88
    correctly determines that the existing code is safe, while
    cppcheck 1.86 reports the warning.
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9732
    behlendorf authored and tonyhutter committed Dec 27, 2019
    Configuration menu
    Copy the full SHA
    6f98f60 View commit details
    Browse the repository at this point in the history

Commits on Jan 3, 2020

  1. Fix zfs-0.8.3 zfs_receive_raw test case

    Fix the zfs_receive_raw test case for zfs-0.8.3 by including the
    one-liner fix from loli10k described here:
    openzfs#9776 (comment)
    
    Signed-off-by: Tony Hutter <hutter2@llnl.gov>
    tonyhutter committed Jan 3, 2020
    Configuration menu
    Copy the full SHA
    9111fe2 View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2020

  1. Fix for ARC sysctls ignored at runtime

    This change leverage module_param_call() to run arc_tuning_update()
    immediately after the ARC tunable has been updated as suggested in
    cffa837 code review.
    A simple test case is added to the ZFS Test Suite to prevent future
    regressions in functionality.
    
    This is a backport of openzfs#9489 provided from:
    openzfs#9776 (comment)
    
    Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
    loli10K authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    e102aee View commit details
    Browse the repository at this point in the history
  2. ZTS: Various test case fixes

    * devices_001_pos and devices_002_neg - Failing after FreeBSD ZTS
      merged due to missing 'function' keyword for create_dev_file_linux.
    
    * pool_state - Occasionally fails due to an insufficient delay
      before checking 'zpool status'.  Increasing the delay from 1 to 3
      seconds resolved the issue in local testing.
    
    * procfs_list_basic - Fails when run in-tree because the logged
      command is actually 'lt-zfs'.  Updated the regex accordingly.
    
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9748
    behlendorf authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    3a7d795 View commit details
    Browse the repository at this point in the history
  3. Update maximum kernel version to 5.4

    Increase the maximum supported kernel version to 5.4.  This was
    verified using the Fedora 5.4.2-300.fc31.x86_64 kernel.
    
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9754
    Closes openzfs#9759
    behlendorf authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    6463bc3 View commit details
    Browse the repository at this point in the history
  4. ZTS: Test case failures

    * large_dnode_008_pos - Force a pool sync before invoking zdb to
      ensure the updated dnode blocks have been persisted to disk.
    
    * refreserv_raidz - Wait for the /dev/zvol links to be both created
      and removed, this is important because the same device volume
      names are being used repeatedly.
    
    * btree_test - Add missing .gitignore file for btree_test binary.
    
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9769
    behlendorf authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    4059d0f View commit details
    Browse the repository at this point in the history
  5. Cancel initialize and TRIM before vdev_metaslab_fini()

    Any running 'zpool initialize' or TRIM must be cancelled prior
    to the vdev_metaslab_fini() call in spa_vdev_remove_log() which
    will unload the metaslabs and set ms->ms_group == NULL.
    
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#8602
    Closes openzfs#9751
    behlendorf authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    f23c406 View commit details
    Browse the repository at this point in the history
  6. libspl: declare aok extern in header

    Rather than defining a new instance of 'aok' in every compilation
    unit which includes this header, there is a single instance
    defined in zone.c, and the header now only declares an extern.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Paul Zuchowski <pzuchowski@datto.com>
    Signed-off-by: Nick Black <dankamongmen@gmail.com>
    Closes openzfs#9752
    dankamongmen authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    ac44630 View commit details
    Browse the repository at this point in the history
  7. In initramfs, do not prompt if keylocation is "file://"

    If the encryption key is stored in a file, the initramfs should not
    prompt for the password. For example, this could be the case if the boot
    partition is stored on removable media that is only present at boot time
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Garrett Fields <ghfields@gmail.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Sam Lunt <samuel.j.lunt@gmail.com>
    Closes openzfs#9764
    sam-lunt authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    9b64145 View commit details
    Browse the repository at this point in the history
  8. Avoid some crashes when importing a pool with corrupt metadata

    - Skip invalid DVAs when importing pools in readonly mode
      (in addition to when the config is untrusted).
    
    - Upon encountering a DVA with a null VDEV, fail gracefully
      instead of panicking with a NULL pointer dereference.
    
    Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Steve Mokris <smokris@softpixel.com>
    Closes openzfs#9022
    smokris authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    0f30b5e View commit details
    Browse the repository at this point in the history
  9. ZTS: devices_001_pos and devices_002_neg

    Update the devices_001_pos and devices_002_neg test cases such that the
    special block device file created is backed by a ZFS volume.  Specifying
    a specific device allows the major and minor numbers to be easily
    determined.  Furthermore, this avoids the potentially dangerous behavior
    of opening the first block device we happen to find under /dev/.
    
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9773
    behlendorf authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    8bbdf83 View commit details
    Browse the repository at this point in the history
  10. ZTS: zfs_program_json

    As of Python 3.5 the default behavior of json.tool was changed to
    preserve the input order rather than lexical order.  The test case
    expects the output to be sorted so apply the --sort-keys option
    to the json.tool command when using Python 3.5 and the option is
    supported.
    
        https://docs.python.org/3/library/json.html#module-json.tool
    
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9774
    behlendorf authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    162a2ec View commit details
    Browse the repository at this point in the history
  11. ZTS: Replace /var/tmp with $TEST_BASE_DIR

    Remove a few hardcoded instances of /var/tmp.  This should use
    the $TEST_BASE_DIR in order to allow the ZTS to be optionally
    run in an alternate directory using `zfs-tests.sh -d <path>`.
    
    Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Igor Kozhukhov <igor@dilos.org>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9775
    behlendorf authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    2f3d42b View commit details
    Browse the repository at this point in the history
  12. ZTS: Fix pool_state cleanup

    The externally faulted vdev should be brought back online and have
    its errors cleared before the pool is destroyed.  Failure to do so
    will leave a vdev with a valid active label.  This vdev may then
    not be used to create a new pool without the -f flag potentially
    leading to subsequent test failures.
    
    Additionally remove an unreachable log_pass from setup.ksh.
    
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9777
    behlendorf authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    ce740ee View commit details
    Browse the repository at this point in the history
  13. zfs-load-key.sh: ${ZFS} is not the zfs binary

    A change[1] was merged yesterday that should refer
    to the zfs binary in the initramfs, but is actually
    an unset shell variable.
    
    This commit changes this line to call `zfs` directly
    like the surrounding code.
    
    [1]: cb5b875
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Garrett Fields <ghfields@gmail.com>
    Reviewed-by: Richard Laager <rlaager@wiktel.com>
    Signed-off-by: Ben Cordero <bencord0@condi.me>
    Closes openzfs#9780
    bencord0 authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    8372bf3 View commit details
    Browse the repository at this point in the history
  14. zdb: print block checksums with 6 d's of verbosity

    Include checksums in the output of 'zdb -dddddd' along
    with other indirect block information already displayed.
    
    Example output follows (with long lines trimmed):
    
    $ zdb -dddddd tank/fish 128
    Dataset tank/fish [ZPL], ID 259, cr_txg 10, 16.2M, 93 objects, rootbp DV
    
        Object  lvl   iblk   dblk  dsize  dnsize  lsize   %full  type
           128    2   128K   128K   634K     512     1M  100.00  ZFS plain f
                                                   168   bonus  System attri
        dnode flags: USED_BYTES USERUSED_ACCOUNTED USEROBJUSED_ACCOUNTED
        dnode maxblkid: 7
        path    /c
        uid     0
        gid     0
        atime    Sat Dec 21 10:49:26 2019
        mtime    Sat Dec 21 10:49:26 2019
        ctime    Sat Dec 21 10:49:26 2019
        crtime    Sat Dec 21 10:49:26 2019
        gen    41
        mode    100755
        size    964592
        parent    34
        links    1
        pflags    40800000104
    Indirect blocks:
                   0 L1  0:2c0000:400 0:c021e00:400 20000L/400P F=8 B=41/41
                   0  L0 0:227800:13800 20000L/13800P F=1 B=41/41 cksum=167a
               20000  L0 0:25ec00:17c00 20000L/17c00P F=1 B=41/41 cksum=2312
               40000  L0 0:276800:18400 20000L/18400P F=1 B=41/41 cksum=24e0
               60000  L0 0:2a7800:18800 20000L/18800P F=1 B=41/41 cksum=25be
               80000  L0 0:28ec00:18c00 20000L/18c00P F=1 B=41/41 cksum=2579
               a0000  L0 0:24d000:11c00 20000L/11c00P F=1 B=41/41 cksum=140a
               c0000  L0 0:23b000:12000 20000L/12000P F=1 B=41/41 cksum=164e
               e0000  L0 0:221e00:5a00 20000L/5a00P F=1 B=41/41 cksum=9de790
    
            segment [0000000000000000, 0000000000100000) size    1M
    
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ned Bass <bass6@llnl.gov>
    nedbass authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    e0a87b8 View commit details
    Browse the repository at this point in the history
  15. ZTS: Cleanup partition tables

    The cleanup_devices function should remove any partitions created
    on the device and force the partition table to be reread.  This
    is needed to ensure that blkid has an up to date version of what
    devices and partitions are used by zfs.
    
    The cleanup_devices call was removed from inuse_008_pos.ksh since
    it operated on partitions instead of devices and was not needed.
    
    Lastly ddidecode may be called by parted and was therefore added
    to the constrained path.
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9806
    behlendorf authored and tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    4ad592c View commit details
    Browse the repository at this point in the history
  16. Fix zfs-0.8.3 'make lint' warnings

    Fix these lint warnings on zfs-0.8.3:
    
    $ make lint
    [module/spl/spl-vnode.c:494]: (error) Uninitialized variable: fp
    [module/spl/spl-vnode.c:706]: (error) Uninitialized variable: fp
    [module/spl/spl-vnode.c:706]: (error) Uninitialized variable: next_fp
    ^CMakefile:1632: recipe for target 'cppcheck' failed
    make: *** [cppcheck] Interrupt
    
    Signed-off-by: Tony Hutter <hutter2@llnl.gov>
    tonyhutter committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    ad3dbdf View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2020

  1. Fix QAT allocation failure return value

    When qat_compress() fails to allocate the required contiguous memory
    it mistakenly returns success.  This prevents the fallback software
    compression from taking over and (un)compressing the block.
    
    Resolve the issue by correctly setting the local 'status' variable
    on all exit paths.  Furthermore, initialize it to CPA_STATUS_FAIL
    to ensure qat_compress() always fails safe to guard against any
    similar bugs in the future.
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes openzfs#9784
    Closes openzfs#9788
    behlendorf authored and tonyhutter committed Jan 22, 2020
    Configuration menu
    Copy the full SHA
    8d26607 View commit details
    Browse the repository at this point in the history
  2. Prevent unnecessary resilver restarts

    If a device is participating in an active resilver, then it will have a
    non-empty DTL. Operations like vdev_{open,reopen,probe}() can cause the
    resilver to be restarted (or deferred to be restarted later), which is
    unnecessary if the DTL is still covered by the current scan range. This
    is similar to the logic in vdev_dtl_should_excise() where the DTL can
    only be excised if it's max txg is in the resilvered range.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: John Gallagher <john.gallagher@delphix.com>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: John Poduska <jpoduska@datto.com>
    Issue openzfs#840
    Closes openzfs#9155
    Closes openzfs#9378
    Closes openzfs#9551
    Closes openzfs#9588
    jwpoduska authored and tonyhutter committed Jan 22, 2020
    Configuration menu
    Copy the full SHA
    f5ff772 View commit details
    Browse the repository at this point in the history
  3. ZTS: Fixes for spurious failures of resilver_restart_001 test

    The resilver restart test was reported as failing about 2% of the
    time. Two issues were found:
    
    - The event log wasn't large enough, so resilver events were missing
    - One 'zpool sync' wasn't enough for resilver to start after zinject
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: John Kennedy <john.kennedy@delphix.com>
    Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl>
    Signed-off-by: John Poduska <jpoduska@datto.com>
    Issue openzfs#9588
    Closes openzfs#9677
    Closes openzfs#9703
    jwpoduska authored and tonyhutter committed Jan 22, 2020
    Configuration menu
    Copy the full SHA
    6c5fc8e View commit details
    Browse the repository at this point in the history
  4. Fix zfs-0.8.3 "qat.h"

    This applies the patch from:
    
    openzfs#9476 (comment)
    
    ...which was originally from:
    
    9fa8b5b  QAT related bug fixes
    
    This allows QAT to build.
    
    Signed-off-by: Tony Hutter <hutter2@llnl.gov>
    tonyhutter committed Jan 22, 2020
    Configuration menu
    Copy the full SHA
    81cd142 View commit details
    Browse the repository at this point in the history
  5. Tag zfs-0.8.3

    META file and changelog updated.
    
    Signed-off-by: Tony Hutter <hutter2@llnl.gov>
    
    TEST_ZIMPORT_SKIP="yes"
    tonyhutter committed Jan 22, 2020
    Configuration menu
    Copy the full SHA
    e4bd681 View commit details
    Browse the repository at this point in the history