This project is mirrored from https://github.com/openzfs/zfs.git. Pull mirroring updated .
  1. 09 May, 2021 7 commits
  2. 08 May, 2021 9 commits
    • illiliti's avatar
      copy-builtin: posix conformance · 36e8abee
      illiliti authored
      
      
      This commits contains changes to allow running `copy-builtin` without
      bash + some minor improvements.
      
      changed shebang to /bin/sh
      added -f option to `set` to globally disable unneeded globbing
      replaced all `echo` commands within add_after() with `printf`
      alternative to avoid possible issues with options (-neE)
      dropped non-portable superfluous `readlink` command
      replaced superfluous `true` command with `:` builtin alternative
      replaced non-portable `--recursive` option of `cp` command with `-R`
      alternative
      dropped non-portable `local` keyword
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarilliliti <illiliti@protonmail.com>
      Closes #12004
      36e8abee
    • Brian Behlendorf's avatar
      Fix dRAID self-healing short columns · 93c8e91f
      Brian Behlendorf authored
      When dRAID performs a normal read operation only the data columns
      in the raid map are read from disk.  This is enough information to
      calculate the checksum, verify it, and return the needed data to the
      application.  It's only in the event of a checksum failure that the
      additional parity and any empty columns must be read since they are
      required for parity reconstruction.
      
      Reading these additional columns is handled by vdev_raidz_read_all()
      which calls vdev_draid_map_alloc_empty() to expand the raid_map_t
      and submit IOs for the missing columns.  This all works correctly,
      but it fails to account for any "short" columns.  These are data
      columns which are padded with a empty skip sector at the end.
      Since that empty sector is not needed for a normal read it's not
      read when columns is first read from disk.  However, like the parity
      and empty columns the skip sector is needed to perform reconstruction.
      
      The fix is to mark any "short" columns as never being rea...
      93c8e91f
    • наб's avatar
    • наб's avatar
      Replace ZoL with OpenZFS where applicable · 1966e959
      наб authored
      Afterward, git grep ZoL matches:
        * README.md:  * [ZoL Site](https://zfsonlinux.org
      
      )
        - Correct
        * etc/default/zfs.in:# ZoL userland configuration.
        - Changing this would induce a needless upgrade-check,
          if the user has modified the configuration;
          this can be updated the next time the defaults change
        * module/zfs/dmu_send.c:   * ZoL < 0.7 does not handle [...]
        - Before 0.7 is ZoL, so fair enough
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarAhelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
      Issue #11956
      1966e959
    • Ryan Moeller's avatar
      FreeBSD: Remove !FreeBSD ifdef'd code · 8c0991e8
      Ryan Moeller authored
      
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Reviewed-by: default avatarAlexander Motin <mav@FreeBSD.org>
      Signed-off-by: default avatarRyan Moeller <ryan@iXsystems.com>
      Closes #11994
      8c0991e8
    • Ryan Moeller's avatar
      Clean up use of zfs_log_create in zfs_dir · 0dd7da9d
      Ryan Moeller authored
      
      
      zfs_log_create returns void, so there is no reason to cast its return
      value to void at the call site.
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Reviewed-by: default avatarAlexander Motin <mav@FreeBSD.org>
      Signed-off-by: default avatarRyan Moeller <ryan@iXsystems.com>
      Closes #11994
      0dd7da9d
    • наб's avatar
      zed: protect against wait4()/fork() races to the global PID table · 3bd6b0e0
      наб authored
      
      
      This can be very easily triggered by adding a sleep(1) before
      the wait4() on a PID-starved system: the reaper thread would wait
      for a child before its entry appeared, letting old entries accumulate:
      
        Invoking "all-debug.sh" eid=3021 pid=391
        Finished "(null)" eid=0 pid=391 time=0.002432s exit=0
        Invoking "all-syslog.sh" eid=3021 pid=336
        Finished "(null)" eid=0 pid=336 time=0.002432s exit=0
        Invoking "history_event-zfs-list-cacher.sh" eid=3021 pid=347
        Invoking "all-debug.sh" eid=3022 pid=349
        Finished "history_event-zfs-list-cacher.sh" eid=3021 pid=347
                                                    time=0.001669s exit=0
        Finished "(null)" eid=0 pid=349 time=0.002404s exit=0
        Invoking "all-syslog.sh" eid=3022 pid=370
        Finished "(null)" eid=0 pid=370 time=0.002427s exit=0
        Invoking "history_event-zfs-list-cacher.sh" eid=3022 pid=391
        avl_find(tree, new_node, &where) == NULL
        ASSERT at ../../module/avl/avl.c:641:avl_add()
        Thread 1 "zed" received signal SIGABRT, Aborted.
      
      By employing this wider lock, we atomise [wait, remove] and [fork, add]:
      slowing down the reaper thread now just causes some zombies
      to accumulate until it can get to them
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Reviewed-by: default avatarDon Brady <don.brady@delphix.com>
      Signed-off-by: default avatarAhelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
      Closes #11963
      Closes #11965
      3bd6b0e0
    • Alyssa Ross's avatar
      Return required size when encode_fh size too small · c074a7de
      Alyssa Ross authored
      
      
      Quoting <linux/exportfs.h>:
      
      > encode_fh() should return the fileid_type on success and on error
      > returns 255 (if the space needed to encode fh is greater than
      > @max_len*4 bytes). On error @max_len contains the minimum size (in 4
      > byte unit) needed to encode the file handle.
      
      ZFS was not setting max_len in the case where the handle was too
      small.  As a result of this, the `t_name_to_handle_at.c' example in
      name_to_handle_at(2) did not work on ZFS.
      
      zfsctl_fid() will itself set max_len if called with a fid that is too
      small, so if we give zfs_fid() that behavior as well, the fix is quite
      easy: if the handle is too small, just use a zero-size fid instead of
      the handle.
      
      Tested by running t_name_to_handle_at on a normal file, a directory, a
      .zfs directory, and a snapshot.
      
      Thanks-to: Puck Meerburg <puck@puckipedia.com>
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Reviewed-by: default avatarTony Nguyen <tony.nguyen@delphix.com>
      Signed-off-by: default avatarAlyssa Ross <hi@alyssa.is>
      Closes #11995 
      c074a7de
    • Alexander Motin's avatar
      Simplify/fix dnode_move() for dn_zfetch · 4fb9e563
      Alexander Motin authored
      
      
      Previous code tried to keep prefetch streams while moving dnode.  But
      it was at least not updating per-stream zs_fetchback pointers, causing
      use-after-free on next access.  Instead of that I see much easier and
      cleaner to just drop old prefetch state and start new from scratch.
      Reviewed-by: default avatarMatthew Ahrens <mahrens@delphix.com>
      Reviewed-by: default avatarIgor Kozhukhov <igor@dilos.org>
      Signed-off-by: default avatarAlexander Motin <mav@FreeBSD.org>
      Sponsored-By: iXsystems, Inc.
      Closes #11936
      Closes #11998
      4fb9e563
  3. 07 May, 2021 2 commits
    • Matthew Ahrens's avatar
      undocumented libzfs API changes broke "zfs list" · 610cb4fb
      Matthew Ahrens authored
      While OpenZFS does permit breaking changes to the libzfs API, we should
      avoid these changes when reasonably possible, and take steps to mitigate
      the impact to consumers when changes are necessary.
      
      Commit e4288a83 made a libzfs API change that is especially
      difficult for consumers because there is no change to the function
      signatures, only to their behavior.  Therefore, consumers can't notice
      that there was a change at compile time.  Also, the API change was
      incompletely and incorrectly documented.
      
      The commit message mentions `zfs_get_prop()` [sic], but all callers of
      `get_numeric_property()` are impacted: `zfs_prop_get()`,
      `zfs_prop_get_numeric()`, and `zfs_prop_get_int()`.
      
      `zfs_prop_get_int()` always calls `get_numeric_property(src=NULL)`, so
      it assumes that the filesystem is not mounted.  This means that e.g.
      `zfs_prop_get_int(ZFS_PROP_MOUNTED)` always returns 0.
      
      The documentation says that to preserve the previous behavior, callers
      should initialize `*src=ZPROP_SRC_NONE`, and some callers were changed
      to do that.  However, the existing behavior is actually preserved by
      initializing `*src=ZPROP_SRC_ALL`, not `NONE`.
      
      The code comment above `zfs_prop_get()` says, "src: ... NULL will be
      treated as ZPROP_SRC_ALL.".  However, the code actually treats NULL as
      ZPROP_SRC_NONE.  i.e. `zfs_prop_get(src=NULL)` assumes that the
      filesystem is not mounted.
      
      There are several existing calls which use `src=NULL` which are impacted
      by the API change, most noticeably those used by `zfs list`, which now
      assumes that filesystems are not mounted.  For example,
      `zfs list -o name,mounted` previously indicated whether a filesystem was
      mounted or not, but now it always (incorrectly) indicates that the
      filesystem is not mounted (`MOUNTED: no`).  Similarly, properties that
      are set at mount time are ignored.  E.g. `zfs list -o name,atime` may
      display an incorrect value if it was set at mount time.
      
      To address these problems, this commit reverts commit e4288a83
      
      :
      "zfs get: don't lookup mount options when using "-s local""
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarMatthew Ahrens <mahrens@delphix.com>
      Closes #11999 
      610cb4fb
    • Ryan Moeller's avatar
      FreeBSD: Initialize/destroy zp->z_lock · b1e44cdc
      Ryan Moeller authored
      
      
      zp->z_lock is used in shared code for protecting projid and scantime.
      We don't exercise these paths much if at all on FreeBSD, so have been
      lucky enough not to have issues with the uninitialized locks so far.
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Reviewed-by: default avatarAlexander Motin <mav@FreeBSD.org>
      Signed-off-by: default avatarRyan Moeller <ryan@ixsystems.com>
      Closes #12003
      b1e44cdc
  4. 06 May, 2021 1 commit
  5. 01 May, 2021 7 commits
  6. 30 Apr, 2021 6 commits
  7. 28 Apr, 2021 2 commits
    • Nathaniel Wesley Filardo's avatar
      vdev_mirror: don't scrub/resilver devices that can't be read · 056a658d
      Nathaniel Wesley Filardo authored
      
      
      This ensures that we don't accumulate checksum errors against offline or
      unavailable devices but, more importantly, means that we don't
      needlessly create DTL entries for offline devices that are already
      up-to-date.
      
      Consider a 3-way mirror, with disk A always online (and so always with
      an empty DTL) and B and C only occasionally online.  When A & B resilver
      with C offline, B's DTL will effectively be appended to C's due to these
      spurious ZIOs even as the resilver empties B's DTL:
      
        * These ZIOs land in vdev_mirror_scrub_done() and flag an error
      
        * That flagged error causes vdev_mirror_io_done() to see
          unexpected_errors, so it issues a ZIO_TYPE_WRITE repair ZIO, which
          inherits ZIO_FLAG_SCAN_THREAD because zio_vdev_child_io() includes
          that flag in ZIO_VDEV_CHILD_FLAGS.
      
        * That ZIO fails, too, and eventually zio_done() gets its hands on it
          and calls vdev_stat_update().
      
        * vdev_stat_update() sees the error and this zio...
      
          * is not speculative,
          * is not due to EIO (but rather ENXIO, since the device is closed)
          * has an ->io_vd != NULL (specifically, the offline leaf device)
          * is a write
          * is for a txg != 0 (but rather the read block's physical birth txg)
          * has ZIO_FLAG_SCAN_THREAD asserted
      
        * So: vdev_stat_update() calls vdev_dtl_dirty() on the offline vdev.
      
      Then, when A & C resilver with B offline, that story gets replayed and
      C's DTL will be appended to B's.
      
      In fact, one does not need this permanently-broken-mirror scenario to
      induce badness: breaking a mirror with no DTLs and then scrubbing will
      create DTLs for all offline devices.  These DTLs will persist until the
      entire mirror is reassembled for the duration of the *resilver*, which,
      incidentally, will not consider the devices with good data to be sources
      of good data in the case of a read failure.
      Reviewed-by: default avatarMark Maybee <mark.maybee@delphix.com>
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarNathaniel Wesley Filardo <nwfilardo@gmail.com>
      Closes #11930
      056a658d
    • Brian Behlendorf's avatar
      zfs.spec.in: remove post ldconfig scriptlets · 91971455
      Brian Behlendorf authored
      In Fedora 28 the packaging guidelines were changed such that ldconfig
      should no longer be called in either the %post or %postun scriptlets.
      Instead the new compatibility macros %ldconfig_post, %ldconfig_postun,
      and %ldocnfig_scriptlets should be used.
      
      Since we only currently support Fedora 31 and newer, we could drop
      %post or %postun scriptlets entirely according to the guidelines.
      However, since we also use the same spec file for CentOS / RHEL
      it's convenient to call the macros which are available starting
      with CentOS / RHEL 8.  For CentOS / RHEL 7 we must still call
      ldconfig in the traditional way.
      
      https://fedoraproject.org/wiki/Changes/Removing_ldconfig_scriptlets
      
      Reviewed-by: default avatarOlaf Faaland <faaland1@llnl.gov>
      Reviewed-by: default avatarTony Hutter <hutter2@llnl.gov>
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Closes #11931 
      91971455
  8. 27 Apr, 2021 6 commits