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

Merge zfs-2.1.6 #98

Merged
42 commits merged into from
Oct 11, 2022
Merged

Merge zfs-2.1.6 #98

42 commits merged into from
Oct 11, 2022

Commits on Sep 13, 2022

  1. Fix use-after-free in btree code

    Coverty static analysis found these.
    
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Neal Gompa <ngompa@datto.com>
    Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
    Closes openzfs#10989
    Closes openzfs#13861
    ryao authored and tonyhutter committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    8131a96 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2022

  1. rpm: Use the correct version-release information in dependencies

    This tightly links the subpackages together and ensures that everything
    is upgraded together.
    
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Neal Gompa <ngompa@datto.com>
    Closes openzfs#13489
    Conan-Kudo authored and tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    e1b49e3 View commit details
    Browse the repository at this point in the history
  2. rpm: Silence "unversioned Obsoletes" warnings on EL 9

    Get rid of RPM warnings on AlmaLinux 9:
    
    "It's not recommended to have unversioned Obsoletes"
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Tony Hutter <hutter2@llnl.gov>
    Closes openzfs#13584
    Closes openzfs#13638
    tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    f48d9b4 View commit details
    Browse the repository at this point in the history
  3. zed: Ignore false 'atari' partitions in autoreplace

    libudev will sometimes falsely identify an 'atari' partition on a
    blank disk, preventing it from being used in an autoreplace.  This
    seems to be a known issue.  The workaround is to just ignore the
    fake partition and continue with the autoreplace.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Tony Hutter <hutter2@llnl.gov>
    Closes openzfs#13497
    Closes openzfs#13632
    tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    acd7464 View commit details
    Browse the repository at this point in the history
  4. zed: Look for NVMe DEVPATH if no ID_BUS

    We tried replacing an NVMe drive using autoreplace, only
    to see zed reject it with:
    
    zed[27955]: zed_udev_monitor: /dev/nvme5n1 no devid source
    
    This happened because ZED saw that ID_BUS was not set by udev
    for the NVMe drive, and thus didn't think it was "real drive".
    This commit allows NVMe drives to be autoreplaced even if
    ID_BUS is not set.
    
    Reviewed-by: Don Brady <don.brady@intel.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Tony Hutter <hutter2@llnl.gov>
    Closes openzfs#13512
    Closes openzfs#13646
    tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    65f8f92 View commit details
    Browse the repository at this point in the history
  5. ZTS: Fix zpool_expand_001_pos

    `zpool_expand_001_pos` was often failing due to not seeing autoexpand
    commands in the `zpool history`.  During testing, I found this to be
    unreliable (sometimes the "online" wouldn't appear in `zpool history`)
    and unnecessary, as we could simply check that the pool increased in
    size.
    
    This commit revamps the test to check for the expanded pool size
    and corresponding new free space.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Tony Hutter <hutter2@llnl.gov>
    Closes openzfs#13743
    tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    b1be0a5 View commit details
    Browse the repository at this point in the history
  6. Importing from cachefile can trip assertion

    When importing from cachefile, it is possible that the builtin retry
    logic will trip an assertion because it also fails to find the pool.
    This fix addresses that case and returns the correct error message to
    the user.
    
    Reviewed-by: Richard Yao <ryao@gentoo.org>
    Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: George Wilson <gwilson@delphix.com>
    Closes openzfs#13781
    grwilson authored and tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    15b64fb View commit details
    Browse the repository at this point in the history
  7. Apply arc_shrink_shift to ARC above arc_c_min

    It makes sense to free memory in smaller chunks when approaching
    arc_c_min to let other kernel subsystems to free more, since after
    that point we can't free anything.  This also matches behavior on
    Linux, where to shrinker reported only the size above arc_c_min.
    
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Reviewed-by: Allan Jude <allan@klarasystems.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Alexander Motin <mav@FreeBSD.org>
    Closes openzfs#13794
    amotin authored and tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    b6ebf27 View commit details
    Browse the repository at this point in the history
  8. FreeBSD: Mark ZFS_MODULE_PARAM_CALL as MPSAFE

    ZFS_MODULE_PARAM_CALL handlers implement their own locking if needed
    and do not require Giant.
    
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Closes openzfs#13756
    Ryan Moeller authored and tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    78206a2 View commit details
    Browse the repository at this point in the history
  9. Fix column width in 'zpool iostat -v' and 'zpool list -v'

    This commit fixes a minor spacing issue caused when
    enumerating vdev names, which originated from openzfs#13031
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Akash B <akash-b@hpe.com>
    Signed-off-by: Samuel Wycliffe <samuelwycliffe@gmail.com>
    Closes openzfs#13811
    npc203 authored and tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    aa9e887 View commit details
    Browse the repository at this point in the history
  10. Add xattr_handler support for Android kernels

    Some ARM BSPs run the Android kernel, which has
    a modified xattr_handler->get() function signature.
    This adds support to compile against these kernels.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Signed-off-by: Walter Huf <hufman@gmail.com>
    Closes openzfs#13824
    hufman authored and tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    2010c18 View commit details
    Browse the repository at this point in the history
  11. zed: Fix config_sync autoexpand flood

    Users were seeing floods of `config_sync` events when autoexpand was
    enabled.  This happened because all "disk status change" udev events
    invoke the autoexpand codepath, which calls zpool_relabel_disk(),
    which in turn cause another "disk status change" event to happen,
    in a feedback loop.  Note that "disk status change" happens every time
    a user calls close() on a block device.
    
    This commit breaks the feedback loop by only allowing an autoexpand
    to happen if the disk actually changed size.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Tony Hutter <hutter2@llnl.gov>
    Closes: openzfs#7132
    Closes: openzfs#7366
    Closes openzfs#13729
    tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    7bbfac9 View commit details
    Browse the repository at this point in the history
  12. config: check for parallel(1), use it for cstyle

    Before:
    $ time make cstyle
    real    0m23.118s
    user    0m23.002s
    sys     0m0.114s
    
    After:
    $ time make cstyle
    real    0m4.577s
    user    0m31.487s
    sys     0m0.699s
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
    Issue openzfs#12899
    nabijaczleweli authored and tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    c8f795b View commit details
    Browse the repository at this point in the history
  13. Introduce a tunable to exclude special class buffers from L2ARC

    Special allocation class or dedup vdevs may have roughly the same
    performance as L2ARC vdevs. Introduce a new tunable to exclude those
    buffers from being cacheable on L2ARC.
    
    Reviewed-by: Don Brady <don.brady@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: George Amanakis <gamanakis@gmail.com>
    Closes openzfs#11761
    Closes openzfs#12285
    gamanakis authored and tonyhutter committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    8bd3dca View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2022

  1. Add physical device size to SIZE column in 'zpool list -v'

    Add physical device size/capacity only for physical devices in
    'zpool list -v' instead of displaying "-" in the SIZE column.
    This would make it easier to see the individual device capacity and
    to determine which spares are large enough to replace which devices.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Reviewed-by: Dipak Ghosh <dipak.ghosh@hpe.com>
    Signed-off-by: Akash B <akash-b@hpe.com>
    Closes openzfs#12561
    Closes openzfs#13106
    akashb-22 authored and tonyhutter committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    03fa3ef View commit details
    Browse the repository at this point in the history
  2. vdev_draid_lookup_map() should not iterate outside draid_maps

    Coverity reported this as an out-of-bounds read.
    
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Neal Gompa <ngompa@datto.com>
    Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
    Closes openzfs#13865
    ryao authored and tonyhutter committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    3f7c174 View commit details
    Browse the repository at this point in the history
  3. make DMU_OT_IS_METADATA and DMU_OT_IS_ENCRYPTED return B_TRUE or B_FALSE

    Without this patch, the
    
        ASSERT3U(dbuf_is_metadata(db), ==, arc_is_metadata(buf));
    
    at the beginning of dbuf_assign_arcbuf can panic
    if the object type is a DMU_OT_NEWTYPE that has
    DMU_OT_METADATA set.
    
    While we're at it, fix DMU_OT_IS_ENCRYPTED as well.
    
    Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Signed-off-by: Christian Schwarz <christian.schwarz@nutanix.com>
    Closes openzfs#13842
    problame authored and tonyhutter committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    cde04ba View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2022

  1. zfs recv hangs if max recordsize is less than received recordsize

    - Some optimizations for bqueue enqueue/dequeue.
    - Added a fix to prevent deadlock when both bqueue_enqueue_impl()
    and bqueue_dequeue() waits for signal to be triggered.
    
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
    Closes openzfs#13855
    ixhamza authored and tonyhutter committed Sep 19, 2022
    Configuration menu
    Copy the full SHA
    a5b0d42 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2022

  1. include: move SPA_MINBLOCKSHIFT and zio_encrypt to sys/fs/zfs.h

    These are used by userspace, so should live in a public header
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
    Closes openzfs#12116
    nabijaczleweli authored and tonyhutter committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    faa1e40 View commit details
    Browse the repository at this point in the history
  2. zfs recv hangs if max recordsize is less than received recordsize

    - Some optimizations for bqueue enqueue/dequeue.
    - Added a fix to prevent deadlock when both bqueue_enqueue_impl()
    and bqueue_dequeue() waits for signal to be triggered.
    
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
    Closes openzfs#13855
    ixhamza authored and tonyhutter committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    d5105f0 View commit details
    Browse the repository at this point in the history
  3. Delay ZFS_PROP_SHARESMB property to handle it for encrypted raw receive

    For encrypted raw receive, objset creation is delayed until a call to
    dmu_recv_stream(). ZFS_PROP_SHARESMB property requires objset to be
    populated when calling zpl_earlier_version(). To correctly handle the
    ZFS_PROP_SHARESMB property for encrypted raw receive, this change
    delays setting the property.
    
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
    Closes openzfs#13878
    ixhamza authored and tonyhutter committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    035e52f View commit details
    Browse the repository at this point in the history
  4. Fix incorrect size given to bqueue_enqueue() call in dmu_redact.c

    We pass sizeof (struct redact_record *) rather than sizeof (struct
    redact_record). Passing the pointer size is wrong.
    
    Coverity caught this in two places.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
    Closes openzfs#13885
    ryao authored and tonyhutter committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    5096ed3 View commit details
    Browse the repository at this point in the history
  5. Add zfs_btree_verify_intensity kernel module parameter

    I see a few issues in the issue tracker that might be aided by being
    able to turn this on. We have no module parameter for it, so I would
    like to add one.
    
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
    Closes openzfs#13874
    ryao authored and tonyhutter committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    b66f8d3 View commit details
    Browse the repository at this point in the history
  6. Revert "Reduce dbuf_find() lock contention"

    This reverts commit 34dbc61.  While this
    change resolved the lock contention observed for certain workloads, it
    inadventantly reduced the maximum hash inserts/removes per second.  This
    appears to be due to the slightly higher acquisition cost of a rwlock vs
    a mutex.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    behlendorf authored and tonyhutter committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    91e0215 View commit details
    Browse the repository at this point in the history
  7. Optimize txg_kick() process (openzfs#12274)

    Use dp_dirty_pertxg[] for txg_kick(), instead of dp_dirty_total in
    original code. Extra parameter "txg" is added for txg_kick(), thus it
    knows which txg to kick. Also txg_kick() call is moved from
    dsl_pool_need_dirty_delay() to dsl_pool_dirty_space() so that we can
    know the txg number assigned for txg_kick().
    
    Some unnecessary code regarding dp_dirty_total in txg_sync_thread() is
    also cleaned up.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Signed-off-by: jxdking <lostking2008@hotmail.com>
    Closes openzfs#12274
    jxdking authored and tonyhutter committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    999830a View commit details
    Browse the repository at this point in the history
  8. Add Module Parameter Regarding Log Size Limit

    zfs_wrlog_data_max
    The upper limit of TX_WRITE log data. Once it is reached,
    write operation is blocked, until log data is cleared out
    after txg sync. It only counts TX_WRITE log with WR_COPIED
    or WR_NEED_COPY.
    
    Reviewed-by: Prakash Surya <prakash.surya@delphix.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: jxdking <lostking2008@hotmail.com>
    Closes openzfs#12284
    jxdking authored and tonyhutter committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    d05f303 View commit details
    Browse the repository at this point in the history
  9. Ask libtool to stop hiding some errors

    For openzfs#13083, curiously, it did not print the actual error, just
    that the compile failed with "Error 1".
    
    In theory, this flag should cause it to report errors twice sometimes.
    In practice, I'm pretty okay with reporting some twice if it avoids
    reporting some never.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com>
    Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
    Closes openzfs#13086
    rincebrain authored and tonyhutter committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    ebbbe01 View commit details
    Browse the repository at this point in the history
  10. Improve too large physical ashift handling

    When iterating through children physical ashifts for vdev, prefer
    ones above the maximum logical ashift, that we can actually use,
    but within the administrator defined maximum.
    
    When selecting top-level vdev ashift, do not set it to the defined
    maximum in case physical ashift is even higher, but just ignore one.
    Using the maximum does not prevent misaligned writes, but reduces
    space efficiency.  Since ZFS tries to write data sequentially and
    aggregates the writes, in many cases large misanigned writes may be
    not as bad as the space penalty otherwise.
    
    Allow internal physical ashifts for vdevs higher than SHIFT_MAX.
    May be one day allocator or aggregation could benefit from that.
    
    Reduce zfs_vdev_max_auto_ashift default from 16 (64KB) to 14 (16KB),
    so that ZFS may still use bigger ashifts up to SHIFT_MAX (64KB),
    but only if it really has to or explicitly told to, but not as an
    "optimization".
    
    There are some read-intensive NVMe SSDs that report Preferred Write
    Alignment of 64KB, and attempt to build RAIDZ2 of those leads to a
    space inefficiency that can't be justified.  Instead these changes
    make ZFS fall back to logical ashift of 12 (4KB) by default and
    only warn user that it may be suboptimal for performance.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
    Sponsored by:	iXsystems, Inc.
    Closes openzfs#13798
    amotin authored and tonyhutter committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    44cec45 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2022

  1. Refactor Log Size Limit

    Original Log Size Limit implementation blocked all writes in case of
    limit reached until the TXG is committed and the log is freed.  It
    caused huge delays and following speed spikes in application writes.
    
    This implementation instead smoothly throttles writes, using exactly
    the same mechanism as used for dirty data.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: jxdking <lostking2008@hotmail.com>
    Signed-off-by: Alexander Motin <mav@FreeBSD.org>
    Sponsored-By: iXsystems, Inc.
    Issue openzfs#12284
    Closes openzfs#13476
    amotin authored and tonyhutter committed Sep 26, 2022
    Configuration menu
    Copy the full SHA
    33223cb View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2022

  1. Linux: Fix uninitialized variable usage in zio_do_crypt_data()

    Coverity complained about this. An error from `hkdf_sha512()` before uio
    initialization will cause pointers to uninitialized memory to be passed
    to `zio_crypt_destroy_uio()`. This is a regression that was introduced
    by cf63739. Interestingly, this never
    affected FreeBSD, since the FreeBSD version never had that patch ported.
    Since moving uio initialization to the top of this function would slow
    down the qat_crypt() path, we only move the `memset()` calls to the top
    of the function. This is sufficient to fix this problem.
    
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Reviewed-by: Neal Gompa <ngompa@datto.com>
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
    Closes openzfs#13944
    ryao authored and tonyhutter committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    835e036 View commit details
    Browse the repository at this point in the history
  2. LUA: Fix CVE-2014-5461

    Apply the fix from upstream.
    
    http://www.lua.org/bugs.html#5.2.2-1
    https://www.opencve.io/cve/CVE-2014-5461
    
    It should be noted that exploiting this requires the `SYS_CONFIG`
    privilege, and anyone with that privilege likely has other opportunities
    to do exploits, so it is unlikely that bad actors could exploit this
    unless system administrators are executing untrusted ZFS Channel
    Programs.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
    Closes openzfs#13949
    ryao authored and tonyhutter committed Sep 27, 2022
    Configuration menu
    Copy the full SHA
    c973929 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2022

  1. FreeBSD: Ignore symlink to i386 includes

    A symlink to i386 includes is created in the build dir on amd64 since
    freebsd/freebsd-src@d07600c
    
    Tell git to ignore it like the other include links.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Closes openzfs#13719
    Ryan Moeller authored and tonyhutter committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    8dcd6af View commit details
    Browse the repository at this point in the history
  2. FreeBSD: Fix integer conversion for vnlru_free{,_vfsops}()

    When reviewing openzfs#13875, I noticed that our FreeBSD code has an issue
    where it converts from `int64_t` to `int` when calling
    `vnlru_free{,_vfsops}()`. The result is that if the int64_t is `1 <<
    36`, the int will be 0, since the low bits are 0. Even when some low
    bits are set, a value such as `((1 << 36) + 1)` would truncate to 1,
    which is wrong.
    
    There is protection against this on 32-bit platforms, but on 64-bit
    platforms, there is no check to protect us, so we add a check.
    
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
    Closes openzfs#13882
    ryao authored and tonyhutter committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    55816c6 View commit details
    Browse the repository at this point in the history
  3. FreeBSD: stop passing LK_INTERLOCK to VOP_LOCK

    There is an ongoing effort to eliminate this feature.
    
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
    Closes openzfs#13908
    mjguzik authored and tonyhutter committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    2c8e3e4 View commit details
    Browse the repository at this point in the history
  4. FreeBSD: catch up to 1400068

    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
    Closes openzfs#13909
    mjguzik authored and tonyhutter committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    eec942c View commit details
    Browse the repository at this point in the history
  5. FreeBSD: handle V_PCATCH

    See https://cgit.FreeBSD.org/src/commit/?id=a75d1ddd74312f5dd79bc1e965f7077679659f2e
    
    Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
    Reviewed-by: Alexander Motin <mav@FreeBSD.org>
    Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
    Closes openzfs#13910
    mjguzik authored and tonyhutter committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    63d4838 View commit details
    Browse the repository at this point in the history
  6. zpool: Don't print "repairing" on force faulted drives

    If you force fault a drive that's resilvering, it's scan stats can get
    frozen in time, giving the false impression that it's being resilvered.
    This commit checks the vdev state to see if the vdev is healthy before
    reporting "resilvering" or "repairing" in zpool status.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Tony Hutter <hutter2@llnl.gov>
    Closes openzfs#13927
    Closes openzfs#13930
    tonyhutter committed Sep 28, 2022
    Configuration menu
    Copy the full SHA
    a2705b1 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2022

  1. Fix bad free in skein code

    Clang's static analyzer found a bad free caused by skein_mac_atomic().
    It will allocate a context on the stack and then pass it to
    skein_final(), which attempts to free it. Upon inspection,
    skein_digest_atomic() also has the same problem.
    
    These functions were created to match the OpenSolaris ICP API, so I was
    curious how we avoided this in other providers and looked at the SHA2
    code. It appears that SHA2 has a SHA2Final() helper function that is
    called by the exported sha2_mac_final()/sha2_digest_final() as well as
    the sha2_mac_atomic() and sha2_digest_atomic() functions. The real work
    is done in SHA2Final() while some checks and the free are done in
    sha2_mac_final()/sha2_digest_final().
    
    We fix the use after free in the skein code by taking inspiration from
    the SHA2 code. We introduce a skein_final_nofree() that does most of the
    work, and make skein_final() into a function that calls it and then
    frees the memory.
    
    Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Reviewed-by: Tony Hutter <hutter2@llnl.gov>
    Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
    Closes openzfs#13954
    ryao authored and tonyhutter committed Sep 29, 2022
    Configuration menu
    Copy the full SHA
    566e908 View commit details
    Browse the repository at this point in the history
  2. Tag zfs-2.1.6

    META file and changelog updated.
    
    Signed-off-by: Tony Hutter <hutter2@llnl.gov>
    tonyhutter committed Sep 29, 2022
    Configuration menu
    Copy the full SHA
    6a6bd49 View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2022

  1. Merge tag 'zfs-2.1.6'

    ZFS Version 2.1.6
    
    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Ryan Moeller authored and Ryan Moeller committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    4ee7ed5 View commit details
    Browse the repository at this point in the history
  2. Bump changelog for zfs-2.1.6

    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Ryan Moeller authored and Ryan Moeller committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    2a383a9 View commit details
    Browse the repository at this point in the history
  3. FreeBSD: Fix a pair of bugs in zfs_fhtovp()

    - Add a zfs_exit() call in an error path, otherwise a lock is leaked.
    - Remove the fid_gen > 1 check.  That appears to be Linux-specific:
      zfsctl_snapdir_fid() sets fid_gen to 0 or 1 depending on whether the
      snapshot directory is mounted.  On FreeBSD it fails, making snapshot
      dirs inaccessible via NFS.
    
    Fixes: 43dbf88 ("FreeBSD: vfsops: use setgen for error case")
    Signed-off-by: Mark Johnston <markj@FreeBSD.org>
    (cherry picked from commit ffea814)
    markjdb authored and Ryan Moeller committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    f81b9b9 View commit details
    Browse the repository at this point in the history