1. 15 Jan, 2019 1 commit
  2. 14 Jan, 2019 1 commit
  3. 13 Jan, 2019 6 commits
  4. 10 Jan, 2019 2 commits
    • Brian Behlendorf's avatar
      Provide more flexible object allocation interface · 6955b401
      Brian Behlendorf authored
      
      Object allocation performance can be improved for complex operations
      by providing an interface which returns the newly allocated dnode.
      This allows the caller to immediately use the dnode without incurring
      the expense of looking up the dnode by object number.
      
      The functions dmu_object_alloc_hold(), zap_create_hold(), and
      dmu_bonus_hold_by_dnode() were added for this purpose.
      
      The zap_create_* functions have been updated to take advantage of
      this new functionality.  The dmu_bonus_hold_impl() function should
      really have never been included in sys/dmu.h and was removed.
      It's sole caller was converted to use dmu_bonus_hold_by_dnode().
      
      The new symbols have been exported for use by Lustre.
      Reviewed-by: default avatarTony Hutter <hutter2@llnl.gov>
      Reviewed by: Matt Ahrens <mahrens@delphix.com>
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Closes #8015 
      6955b401
    • Tom Caputi's avatar
      Don't allow dnode allocation if dn_holds != 0 · 58769a4e
      Tom Caputi authored
      
      This patch simply fixes a small bug where dnode_hold_impl() could
      attempt to allocate a dnode that was in the process of being freed,
      but which still had active references. This patch simply adds the
      required check.
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarTom Caputi <tcaputi@datto.com>
      Closes #8249 
      58769a4e
  5. 09 Jan, 2019 1 commit
  6. 08 Jan, 2019 6 commits
    • Neal Gompa (ニール・ゴンパ)'s avatar
      Use ZFS version for pyzfs & drop unused reqs file · 9ef798b7
      Neal Gompa (ニール・ゴンパ) authored
      
      Now that 'pyzfs' is part of the ZFS codebase, it should be
      versioned the same as the rest of the source tree. This eliminates
      confusion on what version of the bindings are being used, especially
      for dependent Python projects that may use the Python dist metadata
      to identify compatible versions of pyzfs to work from.
      
      In addition, a trivial change to drop the unused requirements.txt
      file is included, simply because it's unused and a leftover from
      before it was imported into the ZFS codebase and wired into the
      autotools build scripts.
      Reviewed-by: default avatarloli10K <ezomori.nozomu@gmail.com>
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarNeal Gompa <ngompa@datto.com>
      Closes #8243 
      9ef798b7
    • loli10K's avatar
      zfs receive and rollback can skew filesystem_count · 0f5f2386
      loli10K authored
      
      This commit fixes a small issue which causes both zfs receive and
      rollback operations to incorrectly increase the "filesystem_count"
      property value.
      
      This change also adds a new test group "limits" to the ZFS Test Suite
      to exercise both filesystem_count/limit and snapshot_count/limit
      functionality.
      
      Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
      Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarloli10K <ezomori.nozomu@gmail.com>
      Closes #8232 
      0f5f2386
    • asomers's avatar
      OpenZFS 8473 - scrub does not detect errors on active spares · f384c045
      asomers authored
      
      Scrubbing is supposed to detect and repair all errors in the pool.
      However, it wrongly ignores active spare devices. The problem can
      easily be reproduced in OpenZFS at git rev 0ef125d with these
      commands:
      
          truncate -s 64m /tmp/a /tmp/b /tmp/c
          sudo zpool create testpool mirror /tmp/a /tmp/b spare /tmp/c
          sudo zpool replace testpool /tmp/a /tmp/c
          /bin/dd if=/dev/zero bs=1024k count=63 oseek=1 conv=notrunc of=/tmp/c
          sync
          sudo zpool scrub testpool
          zpool status testpool # Will show 0 errors, which is wrong
          sudo zpool offline testpool /tmp/a
          sudo zpool scrub testpool
          zpool status testpool # Will show errors on /tmp/c,
                                # which should've already been fixed
      
      FreeBSD head is partially affected: the first scrub will detect
      some errors, but the second scrub will detect more.  This same
      test was run on Linux before applying the fix and the FreeBSD
      head behavior was observed.
      
      Authored by: asomers <asomers@FreeBSD.org>
      Reviewed by: Andy Stormont <astormont@racktopsystems.com>
      Reviewed by: Matt Ahrens <mahrens@delphix.com>
      Reviewed by: George Wilson <george.wilson@delphix.com>
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Approved by: Richard Lowe <richlowe@richlowe.net>
      Ported-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Sponsored by: Spectra Logic Corp
      
      OpenZFS-issue: https://www.illumos.org/issues/8473
      FreeBSD-commit: https://github.com/freebsd/freebsd/commit/e20ec8879
      OpenZFS-commit: https://github.com/illumos/illumos-gate/commit/554675ee
      Closes #8251
      f384c045
    • Neal Gompa (ニール・ゴンパ)'s avatar
      Include third party licenses in dist tarballs · 53b5fcd3
      Neal Gompa (ニール・ゴンパ) authored
      
      Since the merge of the Linux Solaris Porting Layer source tree into
      the ZFS codebase, ZFS is now a double-licensed codebase, with the
      former SPL codebase retaining its license (GPLv2+) within the ZFS
      source tree.
      
      However, the license files for SPL were not being included in the
      tarballs generated by autotools. This change corrects that.
      
      In addition, all the other third party licenses in the codebase are
      now properly declared to be included in the dist tarballs.
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarNeal Gompa <ngompa@datto.com>
      Closes #8242 
      53b5fcd3
    • Tony Hutter's avatar
      Fix missing dkms modules after upgrades · 21e000ad
      Tony Hutter authored
      
      If you were upgrading from say, fc28->fc29, on ZFS version X, the RPMs
      macros would get called like this:
      
      %post X.fc29
         - This is the step where fc29 gets built by dkms.
           As part of the build, dkms automatically removes the previous
           modules before building the new ones.  It then builds the new
           modules.
      %preun X.fc28
         - Right before this step, X.fc29 is be built and installed, but
           since it has the same X, it's files get inadvertently removed
           by fc28's uninstall.
      %postun X.fc28
      
      This patch updates %preun X.fc28 to see if we're upgrading or
      uninstalling.  If we're uninstalling, then remove our files. If we're
      upgrading then do nothing, since will know dkms will have already
      removed our files in %post X.fc29.
      
      Note that since this fixes the %preun step, it's effect isn't going
      to be noticed immediately.  It will only be seen when packages
      with this fix are upgraded to a newer version.
      Reviewed-by: default avatarRalf Ertzinger <ralf@skytale.net>
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarTony Hutter <hutter2@llnl.gov>
      Closes #6902 
      Closes #8216 
      21e000ad
    • Neal Gompa (ニール・ゴンパ)'s avatar
      Bump commit subject length to 72 characters · 4efb48ee
      Neal Gompa (ニール・ゴンパ) authored
      
      There's not really a reason to keep the subject length so short,
      since the reason to make it this short was for making nice renders
      of a summary list of the git log. With 72 characters, this still
      works out fine, so let's just raise it to that so that it's easier
      to give slightly more descriptive change summaries.
      
      Reviewed by: Matt Ahrens <mahrens@delphix.com>
      Reviewed-by: default avatarTony Hutter <hutter2@llnl.gov>
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarNeal Gompa <ngompa@datto.com>
      Closes #8250 
      4efb48ee
  7. 07 Jan, 2019 4 commits
    • Benjamin Gentil's avatar
      22448f08
    • Brian Behlendorf's avatar
      Add 'zpool status -i' option · a769fb53
      Brian Behlendorf authored
      
      Only display the full details of the vdev initialization state
      in 'zpool status' output when requested with the -i option.
      By default display '(initializing)' after vdevs when they are
      being actively initialized.  This is consistent with the
      established precident of appending '(resilvering), etc' and
      fits within the default 80 column terminal width making it
      easy to read.
      
      Additionally, updated the 'zpool initialize' documentation to
      make it clear the options are mutually exclusive, but allow
      duplicate options like all other zfs/zpool commands.
      
      Reviewed by: Matt Ahrens <mahrens@delphix.com>
      Reviewed-by: default avatarloli10K <ezomori.nozomu@gmail.com>
      Reviewed-by: default avatarTim Chase <tim@chase2k.com>
      Reviewed-by: default avatarGeorge Wilson <george.wilson@delphix.com>
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Closes #8230
      a769fb53
    • George Wilson's avatar
      zfs initialize performance enhancements · c10d37dd
      George Wilson authored
      
      PROBLEM
      ========
      
      When invoking "zpool initialize" on a pool the command will
      create a thread to initialize each disk. Unfortunately, it does
      this serially across many transaction groups which can result
      in commands taking a long time to return to the user and may
      appear hung. The same thing is true when trying to suspend/cancel
      the operation.
      
      SOLUTION
      =========
      
      This change refactors the way we invoke the initialize interface
      to ensure we can start or stop the intialization in just a few
      transaction groups.
      
      When stopping or cancelling a vdev initialization perform it
      in two phases.  First signal each vdev initialization thread
      that it should exit, then after all threads have been signaled
      wait for them to exit.
      
      On a pool with 40 leaf vdevs this reduces the vdev initialize
      stop/cancel time from ~10 minutes to under a second.  The reason
      for this is spa_vdev_initialize() no longer needs to wait on
      multiple full TXGs per leaf vdev being stopped.
      
      This commit additionally adds some missing checks for the passed
      "initialize_vdevs" input nvlist.  The contents of the user provided
      input "initialize_vdevs" nvlist must be validated to ensure all
      values are uint64s.  This is done in zfs_ioc_pool_initialize() in
      order to keep all of these checks in a single location.
      
      Updated the innvl and outnvl comments to match the formatting used
      for all other new sytle ioctls.
      
      Reviewed by: Matt Ahrens <mahrens@delphix.com>
      Reviewed-by: default avatarloli10K <ezomori.nozomu@gmail.com>
      Reviewed-by: default avatarTim Chase <tim@chase2k.com>
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarGeorge Wilson <george.wilson@delphix.com>
      Closes #8230
      c10d37dd
    • George Wilson's avatar
      OpenZFS 9102 - zfs should be able to initialize storage devices · 619f0976
      George Wilson authored
      
      PROBLEM
      ========
      
      The first access to a block incurs a performance penalty on some platforms
      (e.g. AWS's EBS, VMware VMDKs). Therefore we recommend that volumes are
      "thick provisioned", where supported by the platform (VMware). This can
      create a large delay in getting a new virtual machines up and running (or
      adding storage to an existing Engine). If the thick provision step is
      omitted, write performance will be suboptimal until all blocks on the LUN
      have been written.
      
      SOLUTION
      =========
      
      This feature introduces a way to 'initialize' the disks at install or in the
      background to make sure we don't incur this first read penalty.
      
      When an entire LUN is added to ZFS, we make all space available immediately,
      and allow ZFS to find unallocated space and zero it out. This works with
      concurrent writes to arbitrary offsets, ensuring that we don't zero out
      something that has been (or is in the middle of being) written. This scheme
      can also be applied to existing pools (affecting only free regions on the
      vdev). Detailed design:
              - new subcommand:zpool initialize [-cs] <pool> [<vdev> ...]
                      - start, suspend, or cancel initialization
              - Creates new open-context thread for each vdev
              - Thread iterates through all metaslabs in this vdev
              - Each metaslab:
                      - select a metaslab
                      - load the metaslab
                      - mark the metaslab as being zeroed
                      - walk all free ranges within that metaslab and translate
                        them to ranges on the leaf vdev
                      - issue a "zeroing" I/O on the leaf vdev that corresponds to
                        a free range on the metaslab we're working on
                      - continue until all free ranges for this metaslab have been
                        "zeroed"
                      - reset/unmark the metaslab being zeroed
                      - if more metaslabs exist, then repeat above tasks.
                      - if no more metaslabs, then we're done.
      
              - progress for the initialization is stored on-disk in the vdev’s
                leaf zap object. The following information is stored:
                      - the last offset that has been initialized
                      - the state of the initialization process (i.e. active,
                        suspended, or canceled)
                      - the start time for the initialization
      
              - progress is reported via the zpool status command and shows
                information for each of the vdevs that are initializing
      
      Porting notes:
      - Added zfs_initialize_value module parameter to set the pattern
        written by "zpool initialize".
      - Added zfs_vdev_{initializing,removal}_{min,max}_active module options.
      
      Authored by: George Wilson <george.wilson@delphix.com>
      Reviewed by: John Wren Kennedy <john.kennedy@delphix.com>
      Reviewed by: Matthew Ahrens <mahrens@delphix.com>
      Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
      Reviewed by: Prakash Surya <prakash.surya@delphix.com>
      Reviewed by: loli10K <ezomori.nozomu@gmail.com>
      Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
      Approved by: Richard Lowe <richlowe@richlowe.net>
      Signed-off-by: default avatarTim Chase <tim@chase2k.com>
      Ported-by: default avatarTim Chase <tim@chase2k.com>
      
      OpenZFS-issue: https://www.illumos.org/issues/9102
      OpenZFS-commit: https://github.com/openzfs/openzfs/commit/c3963210eb
      Closes #8230
      619f0976
  8. 06 Jan, 2019 7 commits
  9. 03 Jan, 2019 2 commits
  10. 02 Jan, 2019 1 commit
    • Brian Behlendorf's avatar
      Fix 'zpool remap' freeing race · 65ca2c1e
      Brian Behlendorf authored
      
      The dmu_objset_remap_indirects_impl() logic depends on dnode_hold()
      returning ENOENT for dnodes which will be freed and should be skipped.
      
      This behavior can only be relied upon when taking a new hold and
      while the caller has an open transaction.  This ensures that the
      open txg cannot advance and that a concurrent free will end up
      in the same txg (which is critical).  Relying on an existing hold
      will not prevent dnode_free() from succeeding.
      
      The solution is to take an additional dnode_hold() after assigning
      the transaction.  This ensures the remap will never dirty the dnode
      if it was freed while we were waiting in dmu_tx_assign(, TXG_WAIT).
      
      Randomly set zfs_object_remap_one_indirect_delay_ms in ztest.  This
      increases the likelihood of an operation racing with the remap.
      Converted from ticks to milliseconds.
      
      Reviewed by: Matt Ahrens <mahrens@delphix.com>
      Reviewed by: Tom Caputi <tcaputi@datto.com>
      Reviewed by: Igor Kozhukhov <igor@dilos.org>
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Closes #8215 
      65ca2c1e
  11. 26 Dec, 2018 2 commits
    • Richard Laager's avatar
      Minor tweaks to zfs.8 man page for POSIX ACLs · 06f3fc2a
      Richard Laager authored
      
      * Capitalize POSIX in POSIX ACLs.  This change makes the POSIX 
        in POSIX ACLs all caps, which is both correct and consistent with
        the rest of the man page.
      
      * Slightly reword part of zfs.8.  I tweaked a sentence to add a 
        missing comma, and as long as I was editing, removed a couple
        unnecessary words.
      Reviewed-by: default avatarGeorge Melikov <mail@gmelikov.ru>
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Reviewed-by: default avatarbunder2015 <omfgbunder@gmail.com>
      Signed-off-by: default avatarRichard Laager <rlaager@wiktel.com>
      Closes #8220 
      06f3fc2a
    • Brad Lewis's avatar
      OpenZFS 9284 - arc_reclaim_thread has 2 jobs · 3ec34e55
      Brad Lewis authored
      
      Following the fix for 9018 (Replace kmem_cache_reap_now() with
      kmem_cache_reap_soon), the arc_reclaim_thread() no longer blocks
      while reaping.  However, the code is still confusing and error-prone,
      because this thread has two responsibilities.  We should instead
      separate this into two threads each with their own responsibility:
      
       1. keep `arc_size` under `arc_c`, by calling `arc_adjust()`, which
          improves `arc_is_overflowing()`
      
       2. keep enough free memory in the system, by calling
          `arc_kmem_reap_now()` plus `arc_shrink()`, which improves
          `arc_available_memory()`.
      
      Furthermore, we can use the zthr infrastructure to separate the
      "should we do something" from "do it" parts of the logic, and
      normalize the start up / shut down of the threads.
      
      Authored by: Brad Lewis <brad.lewis@delphix.com>
      Reviewed by: Matt Ahrens <mahrens@delphix.com>
      Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
      Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
      Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
      Reviewed by: Paul Dagnelie <pcd@delphix.com>
      Reviewed by: Dan McDonald <danmcd@joyent.com>
      Reviewed by: Tim Kordas <tim.kordas@joyent.com>
      Reviewed by: Tim Chase <tim@chase2k.com>
      Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
      Ported-by: default avatarBrad Lewis <brad.lewis@delphix.com>
      Signed-off-by: default avatarBrad Lewis <brad.lewis@delphix.com>
      
      OpenZFS-issue: https://www.illumos.org/issues/9284
      OpenZFS-commit: https://github.com/openzfs/openzfs/commit/de753e34f9
      Closes #8165
      3ec34e55
  12. 18 Dec, 2018 1 commit
  13. 15 Dec, 2018 1 commit
  14. 14 Dec, 2018 5 commits