1. 09 May, 2019 2 commits
    • Brian Behlendorf's avatar
      Tag 0.8.0-rc5 · f378f42b
      Brian Behlendorf authored
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      f378f42b
    • Olaf Faaland's avatar
      zpool import progress kstat · ca95f70d
      Olaf Faaland authored
      
      When an import requires a long MMP activity check, or when the user
      requests pool recovery, the import make take a long time.  The user may
      not know why, or be able to tell whether the import is progressing or is
      hung.
      
      Add a kstat which lists all imports currently being processed by the
      kernel (currently only one at a time is possible, but the kstat allows
      for more than one).  The kstat is /proc/spl/kstat/zfs/import_progress.
      
      The kstat contents are as follows:
      pool_guid         load_state multihost_secs  max_txg pool_name
      16667015954387398 3          15              0       tank3
      
      load_state: the value of spa_load_state
      multihost_secs:  seconds until the end of the multihost activity
                       check; if over, or none required, this is 0
      max_txg: current spa_load_max_txg, if rewind is occurring
      
      This could be used by outside tools, such as a pacemaker resource agent,
      to report import progress, or as a part of manual troubleshooting.  The
      zpool import subcommand could also be modified to report this
      information.
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarOlaf Faaland <faaland1@llnl.gov>
      Closes #8696 
      ca95f70d
  2. 08 May, 2019 8 commits
  3. 07 May, 2019 6 commits
    • DeHackEd's avatar
      Make zfs_special_class_metadata_reserve_pct into a parameter · 1f02ecc5
      DeHackEd authored
      
      Exported and documented a new module parameter.
      Reviewed-by: default avatarRichard Laager <rlaager@wiktel.com>
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarDHE <git@dehacked.net>
      Closes #8706 
      1f02ecc5
    • Brian Behlendorf's avatar
      Fix send/recv lost spill block · caf9dd20
      Brian Behlendorf authored
      When receiving a DRR_OBJECT record the receive_object() function
      needs to determine how to handle a spill block associated with the
      object.  It may need to be removed or kept depending on how the
      object was modified at the source.
      
      This determination is currently accomplished using a heuristic which
      takes in to account the DRR_OBJECT record and the existing object
      properties.  This is a problem because there isn't quite enough
      information available to do the right thing under all circumstances.
      For example, when only the block size changes the spill block is
      removed when it should be kept.
      
      What's needed to resolve this is an additional flag in the DRR_OBJECT
      which indicates if the object being received references a spill block.
      The DRR_OBJECT_SPILL flag was added for this purpose.  When set then
      the object references a spill block and it must be kept.  Either
      it is update to date, or it will be replaced by a subsequent DRR_SPILL
      record.  Conversely, if the object being received doesn't reference
      a spill block then any existing spill block should always be removed.
      
      Since previous versions of ZFS do not understand this new flag
      additional DRR_SPILL records will be inserted in to the stream.
      This has the advantage of being fully backward compatible.  Existing
      ZFS systems receiving this stream will recreate the spill block if
      it was incorrectly removed.  Updated ZFS versions will correctly
      ignore the additional spill blocks which can be identified by
      checking for the DRR_SPILL_UNMODIFIED flag.
      
      The small downside to this approach is that is may increase the size
      of the stream and of the received snapshot on previous versions of
      ZFS.  Additionally, when receiving streams generated by previous
      unpatched versions of ZFS spill blocks may still be lost.
      
      OpenZFS-issue: https://www.illumos.org/issues/9952
      FreeBSD-issue: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233277
      
      Reviewed-by: default avatarPaul Dagnelie <pcd@delphix.com>
      Reviewed-by: default avatarMatt Ahrens <mahrens@delphix.com>
      Reviewed-by: default avatarTom Caputi <tcaputi@datto.com>
      Signed-off-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Closes #8668 
      caf9dd20
    • Tomohiro Kusumi's avatar
      Fix `zfs set atime|relatime=off|on` behavior on inherited datasets · 9c53e516
      Tomohiro Kusumi authored
      
      `zfs set atime|relatime=off|on` doesn't disable or enable the property
      on read for datasets whose property was inherited from parent, until
      a dataset is once unmounted and mounted again.
      
      (The properties start to work properly if a dataset is once unmounted
      and mounted again. The difference comes from regular mount process,
      e.g. via zpool import, uses mount options based on properties read
      from ondisk layout for each dataset, whereas
      `zfs set atime|relatime=off|on` just remounts a specified dataset.)
      
      --
       # zpool create p1 <device>
       # zfs create p1/f1
       # zfs set atime=off p1
       # echo test > /p1/f1/test
       # sync
       # zfs list
       NAME    USED  AVAIL     REFER  MOUNTPOINT
       p1      176K  18.9G     25.5K  /p1
       p1/f1    26K  18.9G       26K  /p1/f1
       # zfs get atime
       NAME   PROPERTY  VALUE  SOURCE
       p1     atime     off    local
       p1/f1  atime     off    inherited from p1
       # stat /p1/f1/test | grep Access | tail -1
       Access: 2019-04-26 23:32:33.741205192 +0900
       # cat /p1/f1/test
       test
       # stat /p1/f1/test | grep Access | tail -1
       Access: 2019-04-26 23:32:50.173231861 +0900
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ changed by read(2)
      --
      
      The problem is that zfsvfs::z_atime which was probably intended to keep
      incore atime state just gets updated by a callback function of "atime"
      property change, atime_changed_cb(), and never used for anything else.
      
      Since now that all file read and atime update use a common function
      zpl_iter_read_common() -> file_accessed(), and whether to update atime
      via ->dirty_inode() is determined by atime_needs_update(),
      atime_needs_update() needs to return false once atime is turned off.
      It currently continues to return true on `zfs set atime=off`.
      
      Fix atime_changed_cb() by setting or dropping SB_NOATIME in VFS super
      block depending on a new atime value, so that atime_needs_update() works
      as expected after property change.
      
      The same problem applies to "relatime" except that a self contained
      relatime test is needed. This is because relatime_need_update() is based
      on a mount option flag MNT_RELATIME, which doesn't exist in datasets
      with inherited "relatime" property via `zfs set relatime=...`, hence it
      needs its own relatime test zfs_relatime_need_update().
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarTomohiro Kusumi <kusumi.tomohiro@gmail.com>
      Closes #8674 
      Closes #8675 
      9c53e516
    • Tomohiro Kusumi's avatar
      Linux 5.1 compat: Drop ULLONG_MAX and LLONG_MAX definitions · 75346937
      Tomohiro Kusumi authored
      
      Linux kernel commit 54d50897d544c874562253e2a8f70dfcad22afe8
      "linux/kernel.h: split *_MAX and *_MIN macros into <linux/limits.h>"
      
      which first appeared in 5.1 has moved several macros from
      <linux/kernel.h> to <linux/limits.h>. This broke compilation due to
      header inclusion order against the local header include/spl/sys/types.h
      which also defines ULLONG_MAX and LLONG_MAX if undefined.
      
      It looks like local ULLONG_MAX and LLONG_MAX were never needed
      (or after spl integration ?) as <linux/kernel.h> has had the same
      definitions since an upstream commit
      111ebb6e6f7bd7de6d722c5848e95621f43700d9 in 2.6.18, so drop them.
      
      --
      linux/include/linux/limits.h:17: error: "LLONG_MAX" redefined [-Werror]
       #define LLONG_MAX ((long long)(~0ULL >> 1))
      zfs/include/spl/sys/types.h:35: note: this is the location of the previous definition
       #define LLONG_MAX  ((long long)(~0ULL>>1))
      Reviewed-by: default avatarRichard Laager <rlaager@wiktel.com>
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarTomohiro Kusumi <kusumi.tomohiro@gmail.com>
      Closes #8714 
      75346937
    • Richard Laager's avatar
      Cleanup special/dedup language · c6eaa146
      Richard Laager authored
      
      This standardizes the language on "deduplication tables" rather than
      "dedup data" (which might be read as the data blocks rather than the
      DDT).  Likewise, it standardizes on "small file blocks".  It also
      standardizes on "normal" rather than using both "normal" and "general"
      in the same paragraph. I also replaced "non-specified" with the more
      explicit "non-dedup/special".
      Reviewed-by: default avatarGeorge Melikov <mail@gmelikov.ru>
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarRichard Laager <rlaager@wiktel.com>
      Closes #8713 
      c6eaa146
    • Antonio Russo's avatar
      Fix zfs-mount-generator for datasets with spaces · 6aff30ad
      Antonio Russo authored
      
      Alternative implementation of @rlaager's original modification
      of zfs-mount-generator fix, with @chrisrd's comments. Set
      IFS to be only the tab character, matching our `-H` call in
      `zfs list`, allowing spaces to appear in dataset names (and
      mountpoints).
      
      Also adds comments explaining our rationale.
      Reviewed-by: default avatarChris Dunlop <chris@onthe.net.au>
      Reviewed-by: default avatarRichard Laager <rlaager@wiktel.com>
      Reviewed-by: default avatarGeorge Melikov <mail@gmelikov.ru>
      Signed-off-by: default avatarAntonio Russo <antonio.e.russo@gmail.com>
      Closes #8708 
      Closes #8718 
      6aff30ad
  4. 06 May, 2019 1 commit
  5. 05 May, 2019 1 commit
  6. 04 May, 2019 2 commits
    • Tomohiro Kusumi's avatar
      Linux 5.0 compat: Use totalhigh_pages() · de3e0b91
      Tomohiro Kusumi authored
      
      Linux kernel commit ca79b0c211af63fa3276f0e3fd7dd9ada2439839
      "mm: convert totalram_pages and totalhigh_pages variables to atomic"
      
      replaced `totalhigh_pages` with an inline function `totalhigh_pages()`.
      This broke compilation on IA32, etc, as ZoL uses `totalhigh_pages`
      on archs with highmem. Confirmed on Fedora 30 (5.0.9-301.fc30.i686).
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarTomohiro Kusumi <kusumi.tomohiro@gmail.com>
      Closes #8677
      Closes #8701 
      de3e0b91
    • John Gallagher's avatar
      Improve rate at which new zvols are processed · 1eacf2b3
      John Gallagher authored
      
      The kernel function which adds new zvols as disks to the system,
      add_disk(), briefly opens and closes the zvol as part of its work.
      Closing a zvol involves waiting for two txgs to sync. This, combined
      with the fact that the taskq processing new zvols is single threaded,
      makes this processing new zvols slow.
      
      Waiting for these txgs to sync is only necessary if the zvol has been
      written to, which is not the case during add_disk(). This change adds
      tracking of whether a zvol has been written to so that we can skip the
      txg_wait_synced() calls when they are unnecessary.
      
      This change also fixes the flags passed to blkdev_get_by_path() by
      vdev_disk_open() to be FMODE_READ | FMODE_WRITE | FMODE_EXCL instead of
      just FMODE_EXCL. The flags were being incorrectly calculated because
      we were using the wrong version of vdev_bdev_mode().
      Reviewed-by: default avatarGeorge Wilson <george.wilson@delphix.com>
      Reviewed-by: default avatarSerapheim Dimitropoulos <serapheim@delphix.com>
      Reviewed-by: default avatarBrian Behlendorf <behlendorf1@llnl.gov>
      Signed-off-by: default avatarJohn Gallagher <john.gallagher@delphix.com>
      Closes #8526 
      Closes #8615 
      1eacf2b3
  7. 02 May, 2019 5 commits
  8. 01 May, 2019 3 commits
  9. 30 Apr, 2019 3 commits
  10. 26 Apr, 2019 2 commits
  11. 25 Apr, 2019 7 commits