Displaying 1 50 of 4,445 commits (0.008s)

ZFS on Linux — module/zfs lz4.c

Fix LZ4_uncompress_unknownOutputSize caused panic

Sync with kernel patches for lz4

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/log/lib/lz4

4a3a99 lz4: add overrun checks to lz4_uncompress_unknownoutputsize()
d5e7ca LZ4 : fix the data abort issue
bea2b5 lib/lz4: Pull out constant tables
99b7e9 lz4: fix system halt at boot kernel on x86_64

Reviewed-by: Chunwei Chen <david.chen at osnexus.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Feng Sun <loyou85 at gmail.com>
Closes #5975
Closes #5973
Delta File
+19 -8 module/zfs/lz4.c
+19 -8 1 file

ZFS on Linux — . configure.ac, cmd/zpool zpool_main.c

Implemented zpool sync command

This addition will enable us to sync an open TXG to the main pool
on demand. The functionality is similar to 'sync(2)' but 'zpool sync'
will return when data has hit the main storage instead of potentially
just the ZIL as is the case with the 'sync(2)' cmd.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Signed-off-by: Alek Pinchuk <apinchuk at datto.com>
Closes #6122

ZFS on Linux — cmd/zpool zpool_main.c, include libzfs.h

Force fault a vdev with 'zpool offline -f'

This patch adds a '-f' option to 'zpool offline' to fault a vdev
instead of bringing it offline.  Unlike the OFFLINE state, the
FAULTED state will trigger the FMA code, allowing for things like
autoreplace and triggering the slot fault LED.  The -f faults
persist across imports, unless they were set with the temporary
(-t) flag.  Both persistent and temporary faults can be cleared
with zpool clear.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #6094

ZFS on Linux — . TEST, scripts zconfig.sh Makefile.am

Retire zconfig.sh

All of the test coverage provided by this script is now handled
as part of the ZFS Test Suite.  Remove it.

Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6128
Delta File
+0 -696 scripts/zconfig.sh
+0 -4 TEST
+0 -1 scripts/Makefile.am
+0 -701 3 files

ZFS on Linux — module/zfs zfs_fm.c

Fixed small memory leak in ereport handling

One pre-check in zfs_ereport_start() was being called after
the nvlists were being allocated. This simply corrects that
issue.

Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Closes #6140
Delta File
+6 -6 module/zfs/zfs_fm.c
+6 -6 1 file

ZFS on Linux — tests/runfiles linux.run, tests/zfs-tests/tests/functional/xattr xattr_011_pos.ksh xattr_004_pos.ksh

Enable xattr tests

Updated the xattr_common.ksh helper functions to use the attr
command on Linux to manipulate xattrs.  Added an xattr.cfg file
and reworked the user/group functionality to be consist with
the existing delegate test cases.  The intent of each test
case was preserved.

* xattr_001_pos, xattr_002_neg - Updated to verity xattr=on
  and xattr=sa sytle xattrs.

* xattr_003_neg - Use user_run helper instead of su.

* xattr_004_pos - Updated to work with ext2 xattrs.

* xattr_007_neg - Updated to use attr instead of runat.

* xattr_008_pos, xattr_009_neg8_pos, xattr_010_neg -
  Test cases disables since they aren't applicable to Linux.

* xattr_011_pos - Updated to expected behavior from GNU
  versions of the tested utilities.

* xattr_012_pos - Updated to use xattrtest to create many
  small xattrs instead of a single large one.

    [5 lines not shown]

ZFS on Linux — cmd/zed zed_disk_event.c, cmd/zed/agents zfs_mod.c

Enable remaining tests

Enable most of the remaining test cases which were previously
disabled.  The required fixes are as follows:

* cache_001_pos - No changes required.

* cache_010_neg - Updated to use losetup under Linux.  Loopback
  cache devices are allowed, ZVOLs as cache devices are not.
  Disabled until all the builders pass reliably.

* cachefile_001_pos, cachefile_002_pos, cachefile_003_pos,
  cachefile_004_pos - Set set_device_dir path in cachefile.cfg,
  updated CPATH1 and CPATH2 to reference unique files.

* zfs_clone_005_pos - Wait for udev to create volumes.

* zfs_mount_007_pos - Updated mount options to expected Linux names.

* zfs_mount_009_neg, zfs_mount_all_001_pos - No changes required.

* zfs_unmount_005_pos, zfs_unmount_009_pos, zfs_unmount_all_001_pos -
  Updated to expect -f to not unmount busy mount points under Linux.

* rsend_019_pos - Observed to occasionally take a long time on both

    [74 lines not shown]

ZFS on Linux — . zfs-script-config.sh.in configure.ac, scripts zfs-tests.sh

Add zpool events tests

* events_001_pos - Verify the expected events are generated when
  invoking the various zpool sub-commands.  These events must
  appear in `zpool event` and be consumed by the ZED.

* events_002_pos - Verify the ZED consumes events which were
  generated while it wasn't running when it is started.
  Additionally, verify that events are only processed once.

As part of this change the default.cfg used by the test suite
was changed to a default.cfg.in file.  This was needed so the
install location of all zed scripts, not only the enabled ones,
could be reliably determined.

Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6128

ZFS on Linux — include/sys zfs_ioctl.h

Fix large dnode send stream flag conflict

Bit 21 of the send stream flags was inadvertently used for two
different features under concurrent development.  To avoid any
future compatibility problems the large dnode flag is being
switched to bit 23 which is unused.

The large dnode feature has only been present in pre-releases of
ZoL and dnodesize defaults to legacy which is compatible with
existing OpenZFS implementations.  Users with dnodesize=auto
needing to use zfs send/recv must update ZoL on both the
source and destination systems.

Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Reviewed-by: Ned Bass <bass6 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6139
Delta File
+2 -1 include/sys/zfs_ioctl.h
+2 -1 1 file

ZFS on Linux — lib/libspl getmntany.c

Compatibilty with glibc-2.23

In glibc-2.23 <sys/sysmacros.h> isn't automatically included in
<sys/types.h> [1], so we need ot explicitely include it.

https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Justin Lecher <jlec at gentoo.org>
Closes #6132
Delta File
+1 -0 lib/libspl/getmntany.c
+1 -0 1 file

ZFS on Linux — include/sys vdev_impl.h vdev.h, module/zfs dsl_scan.c vdev_raidz.c

Skip spurious resilver IO on raidz vdev

On a raidz vdev, a block that does not span all child vdevs, excluding
its skip sectors if any, may not be affected by a child vdev outage or
failure. In such cases, the block does not need to be resilvered.
However, current resilver algorithm simply resilvers all blocks on a
degraded raidz vdev. Such spurious IO is not only wasteful, but also
adds the risk of overwriting good data.

This patch eliminates such spurious IOs.

Reviewed-by: Gvozden Neskovic <neskovic at gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Signed-off-by: Isaac Huang <he.huang at intel.com>
Closes #5316

ZFS on Linux — cmd/zpool zpool_vdev.c, scripts zfs-tests.sh

Enable additional test cases

Enable additional test cases, in most cases this required a few
minor modifications to the test scripts.  In a few cases a real
bug was uncovered and fixed.  And in a handful of cases where pools
are layered on pools the test case will be skipped until this is
supported.  Details below for each test case.

* zpool_add_004_pos - Skip test on Linux until adding zvols to pools
  is fully supported and deadlock free.

* zpool_add_005_pos.ksh - Skip dumpadm portion of the test which isn't
  relevant for Linux.  The find_vfstab_dev, find_mnttab_dev, and
  save_dump_dev functions were updated accordingly for Linux.  Add
  O_EXCL to the in-use check to prevent the -f (force) option from
  working for mounted filesystems and improve the resulting error.

* zpool_add_006_pos - Update test case such that it doesn't depend
  on nested pools.  Switch to truncate from mkfile to reduce space
  requirements and speed up the test case.

* zpool_clear_001_pos - Speed up test case by filling filesystem to
  25% capacity.

* zpool_create_002_pos, zpool_create_004_pos - Use sparse files for

    [75 lines not shown]

ZFS on Linux — module/zfs zvol.c

Revert commit 1ee159f4

Fix lock order inversion with zvol_open() as it did not account
for use of zvols as vdevs. The latter use cases resulted in the
lock order inversion deadlocks that involved spa_namespace_lock
and bdev->bd_mutex.

Signed-off-by: Boris Protopopov <boris.protopopov at actifio.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Issue #6065
Issue #6134
Delta File
+29 -2 module/zfs/zvol.c
+29 -2 1 file

ZFS on Linux — module/zfs zvol.c

Introduce zv_state_lock

The lock is designed to protect internal state of zvol_state_t and
to avoid taking spa_namespace_lock (e.g. in dmu_objset_own() code path)
while holding zvol_stat_lock. Refactor the code accordingly.

Signed-off-by: Boris Protopopov <boris.protopopov at actifio.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #3484
Closes #6065
Closes #6134
Delta File
+124 -71 module/zfs/zvol.c
+124 -71 1 file

ZFS on Linux — module/zfs vdev.c

OpenZFS 8166 - zpool scrub thinks it repaired offline device

Authored by: Matthew Ahrens <mahrens at delphix.com>
Reviewed by: George Wilson <george.wilson at delphix.com>
Reviewed-by: loli10K <ezomori.nozomu at gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Ported-by: Matthew Ahrens <mahrens at delphix.com>

If we do a scrub while a leaf device is offline (via "zpool offline"),
we will inadvertently clear the DTL (dirty time log) of the offline
device, even though it is still damaged.  When the device comes back
online, we will incompletely resilver it, thinking that the scrub
repaired blocks written before the scrub was started.  The incomplete
resilver can lead to data loss if there is a subsequent failure of a
different leaf device.

The fix is to never clear the DTL of offline devices.  Note that if a
device is onlined while a scrub is in progress, the scrub will be
restarted.

The problem can be worked around by running "zpool scrub" after
"zpool online".

OpenZFS-issue: https://www.illumos.org/issues/8166
OpenZFS-commit: https://github.com/openzfs/openzfs/pull/372

    [2 lines not shown]
Delta File
+3 -0 module/zfs/vdev.c
+3 -0 1 file

ZFS on Linux — module/zfs arc.c

Add missing arc_free_cksum() to arc_release()

The arc layer tracks checksums of its data in the arc header
so that it can ensure that buffers haven't changed when they're
not supposed to. This checksum is only maintained while there
is an uncompressed buffer still attached to the header.
Unfortunately there is a missing call to arc_free_cksum() in
arc_release() that can trigger ASSERTs. This has not been a
common issue because the checksums are only maintained for
debug builds and triggering the bug requires writing a block
(and therefore calling arc_release()) while a compressed buffer
is still being used on a debug build. This simply corrects the
issue.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Closes #6105
Delta File
+4 -0 module/zfs/arc.c
+4 -0 1 file

ZFS on Linux — config kernel-current-time.m4 kernel.m4, include/linux vfs_compat.h

Linux 4.12 compat: CURRENT_TIME removed

Linux 4.9 added current_time() as the preferred interface to get
the filesystem time.  CURRENT_TIME was retired in Linux 4.12.

Reviewed-by: Chunwei Chen <david.chen at osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6114

ZFS on Linux — cmd/zfs zfs_main.c, include libzfs_core.h

Add property overriding (-o|-x) to 'zfs receive'

This allows users to specify "-o property=value" to override and
"-x property" to exclude properties when receiving a zfs send stream.
Both native and user properties can be specified.

This is useful when using zfs send/receive for periodic
backup/replication because it lets users change properties such as
canmount, mountpoint, or compression without modifying the source.

References:
   https://www.illumos.org/issues/2745
   https://www.illumos.org/issues/3753

Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Reviewed-by: Alek Pinchuk <apinchuk at datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu at gmail.com>
Closes #1350
Closes #5349

ZFS on Linux — include/sys/fs zfs.h, lib/libzfs libzfs_dataset.c

Make createtxg and guid properties public

Document the existence of `createtxg` and `guid` native properties
in man pages and zfs command output.

One of the great features of ZFS is incremental replication of
snapshots, possibly between pools on different machines.

Shell scripts are commonly used to auomate this procedure. They have to
find the most recent common snapshot between both sides and then
perform incremental send & recv.
Currently, scripts rely on the sorting order of `zfs list`, which
defaults to `createtxg`, and the assumption that snapshot names on
either side do not change.

By making `createtxg` and `guid` part of the public ZFS interface,
scripts are enabled to use

  a) `createtxg` to determine the logical & temporal order of snapshots
     (the creation property is not an equivalent substitute since
      multiple snapshots may be created within one second)
  b) `guid` to uniquely identify a snapshot, independent of its current
      display name

This has the potential of making scripts safer and correct.

    [7 lines not shown]

ZFS on Linux — lib/libzfs libzfs_dataset.c

Fix NULL pointer dereference in 'zfs create'

A race condition between 'zpool export' and 'zfs create' can crash the
latter: this is because we never check libzfs`zpool_open() return
value in libzfs`zfs_create().

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu at gmail.com>
Closes #6096
Delta File
+3 -1 lib/libzfs/libzfs_dataset.c
+3 -1 1 file

ZFS on Linux — rpm/generic zfs.spec.in

Fix zfs .deb package warning in prerm script

Debian zfs package generated by alien doesn't call the prerm script
(rpm's %preun) with an integer as first parameter, which results in
the following warning:

   "zfs.prerm: line 2: [: remove: integer expression expected"

Modify the if-condition to avoid the warning.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu at gmail.com>
Closes #6108
Delta File
+1 -1 rpm/generic/zfs.spec.in
+1 -1 1 file

ZFS on Linux — cmd/zpool zpool_main.c

Fix coverity defects: CID 161638

CID 161638: Resource leak (RESOURCE_LEAK)

Ensure the string array in print_zpool_script_help
is freed in cases when there is an error.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Closes #6111
Delta File
+4 -1 cmd/zpool/zpool_main.c
+4 -1 1 file

ZFS on Linux — include/sys zfs_context.h, lib/libzpool kernel.c

Linux 4.12 compat: PF_FSTRANS was removed

zfsonlinux/spl at 8f87971 added __spl_pf_fstrans_check for the xfs related
check, so we use them accordingly.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Chunwei Chen <david.chen at osnexus.com>
Closes #6113

ZFS on Linux — . META

Tag 0.7.0-rc4

Fourth release candidate.

Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Delta File
+1 -1 META
+1 -1 1 file

ZFS on Linux — module/zfs dmu.c

Fix unused variable warning

Remove the lz4_ac local variable from dmu_write_policy() to resolve
the following unused variable warning on non-debug builds.

dmu.c: In function ‘dmu_write_policy’:
dmu.c:1892:12: warning: unused variable ‘lz4_ac’ [-Wunused-variable]
  boolean_t lz4_ac = spa_feature_is_active(os->os_spa,

Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Delta File
+2 -3 module/zfs/dmu.c
+2 -3 1 file

ZFS on Linux — tests/zfs-tests/tests/functional/rsend rsend_014_pos.ksh send-c_volume.ksh

Update rsend_014_pos and send-c_volume test cases

The send-c_volume test case has been observed to occasionally
fail on 32-bit systems.  Until this issue is fully understood
disable this test case.

The rsend_014_pos test case can occasionally fail due to an
EBUSY during export.  This can lead to subsequent test failures.
Resolve the issue by retrying the export on EBUSY.  Additionally,
remove the gratuitous use of eval.

Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6088

ZFS on Linux — tests/runfiles linux.run, tests/zfs-tests/tests/functional/cli_root/zfs_destroy zfs_destroy_005_neg.ksh zfs_destroy_010_pos.ksh

Enable all zfs_destroy test cases

* zfs_destroy_001_pos - Unable to reproduce the failures locally.
  Re-enabled to determine observed buildbot failure rate.

* zfs_destroy_005_neg - Updated for expected Linux behavior.
  Busy mount points, even snapshots, are expected to fail.

* zfs_destroy_010_pos - Resolved transient EBUSY with retry.

Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Issue #5635
Issue #5893
Closes #6091

ZFS on Linux — cmd/zpool zpool_main.c zpool_vdev.c, include/sys spa.h

More ashift improvements

This commit allow higher ashift values (up to 16) in 'zpool create'

The ashift value was previously limited to 13 (8K block) in b41c990
because the limited number of uberblocks we could fit in the
statically sized (128K) vdev label ring buffer could prevent the
ability the safely roll back a pool to recover it.

Since b02fe35 the largest uberblock size we support is 8K: this
allow us to store a minimum number of 16 uberblocks in the vdev
label, even with higher ashift values.

Additionally change 'ashift' pool property behaviour: if set it will
be used as the default hint value in subsequent vdev operations
('zpool add', 'attach' and 'replace'). A custom ashift value can still
be specified from the command line, if desired.

Finally, fix a bug in add-o_ashift.ksh caused by a missing variable.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu at gmail.com>
Closes #2024
Closes #4205
Closes #4740
Closes #5763

ZFS on Linux — man/man5 zfs-module-parameters.5, module/zfs zvol.c

Default to zvol_request_async=0

Change the default ZVOL behavior so requests are handled asynchronously.
This behavior is functionally the same as in the zfs-0.6.4 release.

Reviewed-by: Chunwei Chen <david.chen at osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Issue #5902

ZFS on Linux — include/sys vdev_impl.h, module/zfs vdev_label.c vdev.c

Write label 2,3 uberblocks when vdev expands

When vdev_psize increases, the location of labels 2 and 3 changes
because their location is relative to the end of the device.

The configs for labels 2 and 3 are written during the next spa_sync()
because the vdev is added to the dirty config list.  However, the
uberblock rings are not re-written in their new location, leaving the
device vulnerable to the beginning of the device being overwritten or
damaged.

This patch copies the uberblock ring from label 0 to labels 2 and 3,
in their new locations, at the next sync after vdev_psize increases.

Also, add a test zpool_expand_004_pos.ksh to confirm the uberblocks
are copied.

Reviewed-by: BearBabyLiu <liu.huang at zte.com.cn>
Reviewed-by: Andreas Dilger <andreas.dilger at intel.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Olaf Faaland <faaland1 at llnl.gov>
Closes #5108

ZFS on Linux — cmd/zdb zdb.c, cmd/zfs zfs_main.c

Add zfs_nicebytes() to print human-readable sizes

* Add zfs_nicebytes() to print human-readable sizes

Some 'zfs', 'zpool' and 'zdb' output strings can be confusing to the
user when no units are specified. This add a new zfs_nicenum_format
"ZFS_NICENUM_BYTES" used to print bytes in their human-readable form.

Additionally, update some test cases to use machine-parsable 'zfs get'.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu at gmail.com>
Closes #2414
Closes #3185
Closes #3594
Closes #6032

ZFS on Linux — module/zfs abd.c

minor improvement to abd_free_pages()

It doesn't need to have a loop to free page in a single scatterlist
entry because it should be single or compound page. The pages can be
freed in one invocation to __free_pages() for both cases.

Reviewed-by: Gvozden Neskovic <neskovic at gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Richard Yao <ryao at gentoo.org>
Signed-off-by: Jinshan Xiong <jinshan.xiong at gmail.com>
Closes #6057
Delta File
+6 -8 module/zfs/abd.c
+6 -8 1 file

ZFS on Linux — module/zfs zio.c

Guarantee PAGESIZE alignment for large zio buffers

In current implementation, only zio buffers in 16KB and bigger are
guaranteed PAGESIZE alignment. This breaks Lustre since it assumes
that 'arc_buf_t::b_data' must be page aligned when zio buffers are
greater than or equal to PAGESIZE.

This patch will make the zio buffers to be PAGESIZE aligned when
the sizes are not less than PAGESIZE.

This change may cause a little bit memory waste but that should be
fine because after ABD is introduced, zio buffers are used to hold
data temporarily and live in memory for a short while.

Reviewed-by: Don Brady <don.brady at intel.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Jinshan Xiong <jinshan.xiong at gmail.com>
Signed-off-by: Jinshan Xiong <jinshan.xiong at intel.com>
Closes #6084
Delta File
+2 -2 module/zfs/zio.c
+2 -2 1 file

ZFS on Linux — config kernel-bdi.m4 kernel-bdi-setup-and-register.m4, include/linux vfs_compat.h

Linux 4.12 compat: super_setup_bdi_name()

All filesystems were converted to dynamically allocated BDIs.  The
destruction of backing_dev_info structures is handled as part of
super block destruction.  Refactor the code to abstract away the
details of creating and destroying a BDI.

Reviewed-by: Chunwei Chen <david.chen at osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6089

ZFS on Linux — module/zfs arc.c

Limit zfs_dirty_data_max_max to 4G

Reinstate default 4G zfs_dirty_data_max_max limit.

Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Reviewed-by: Chunwei Chen <david.chen at osnexus.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6072
Closes #6081
Delta File
+3 -3 module/zfs/arc.c
+3 -3 1 file

ZFS on Linux — module/zfs vdev.c

OpenZFS 7786 - zfs`vdev_online() needs better notification about state changes

Authored by: Yuri Pankov <yuri.pankov at nexenta.com>
Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Reviewed by: George Wilson <george.wilson at delphix.com>
Approved by: Albert Lee <trisk at forkgnu.org>
Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Ported-by: bunder2015 <omfgbunder at gmail.com>

OpenZFS-issue: https://www.illumos.org/issues/7786
OpenZFS-commit: http://github.com/openzfs/openzfs/commit/db8498f
Closes #6074
Delta File
+8 -6 module/zfs/vdev.c
+8 -6 1 file

ZFS on Linux — module/zfs qat_compress.c

Change U16 to U32 due to atomic_inc_32_nv

After run a long time with QAT compression, the variable "inst_num"
is overflow by "atomic_inc_32_nv", which causes its neighbor
variable overwritten. Change its definition from U16 to U32.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Weigang Li <weigang.li at intel.com>
Closes #6051
Delta File
+2 -2 module/zfs/qat_compress.c
+2 -2 1 file

ZFS on Linux — man/man5 zfs-module-parameters.5

Update documentation for zfs_vdev_queue_depth_pct

It was documented as being related to zfs_vdev_async_max_active
when it is actually related to zfs_vdev_async_write_max_active.
Also, expand the documentation to describe the allocation throttle
which was introduced as part of OpenZFS 7090 in 3dfb57a.

Reviewed-by: Richard Yao <ryao at gentoo.org>
Reviewed-by: Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tim Chase <tim at chase2k.com>
Closes #6064
Delta File
+10 -2 man/man5/zfs-module-parameters.5
+10 -2 1 file

ZFS on Linux — man/man5 zfs-module-parameters.5

Fix typo in zfs-module-parameters man page

Fix typo in zfs-module-parameters man page

Reviewed-by: Richard Laager <rlaager at wiktel.com>
Reviewed-by: Mike McQuaid <mike at mikemcquaid.com>
Reviewed-by: Paul Dagnelie <pcd at delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Gvozden Neskovic <neskovic at gmail.com>
Reviewed-by: Neal Gompa <ngompa13 at gmail.com>
Reviewed-by: Jason Zaman <jason at perfinion.com>
Reviewed-by: Ned Bass <bass6 at llnl.gov>
Reviewed-by: Jorgen Lundman <lundman at lundman.net>
Reviewed-by: Prakash Surya <prakash.surya at delphix.com>
Reviewed-by: Hajo Möller <dasjoe at gmail.com>
Reviewed-by: Igor Kozhukhov <ikozhukhov at gmail.com>
Reviewed-by: Richard Yao <ryao at gentoo.org>
Reviewed-by: Tim Chase <tim at chase2k.com>
Reviewed-by: DHE <git at dehacked.net>
Reviewed-by: Matthew Thode <prometheanfire at gentoo.org>
Reviewed-by: Thomas Caputi <tcaputi at datto.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: kernelOfTruth <kerneloftruth at gmail.com>
Reviewed-by: Kash Pande <kash at tripleback.net>
Reviewed-by: ilovezfs <ilovezfs at icloud.com>

    [8 lines not shown]
Delta File
+1 -1 man/man5/zfs-module-parameters.5
+1 -1 1 file

ZFS on Linux — man/man5 zfs-module-parameters.5

Typo in zfs-module-parameters(5)

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: DHE <git at dehacked.net>
Closes #6061
Delta File
+1 -1 man/man5/zfs-module-parameters.5
+1 -1 1 file

ZFS on Linux — cmd/zpool zpool_main.c

Fix 'zpool iostat -v' cache and log output

Fixes formatting errors from commit d6418de057

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: loli10K <ezomori.nozomu at gmail.com>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: DHE <git at dehacked.net>
Closes #6060
Delta File
+2 -0 cmd/zpool/zpool_main.c
+2 -0 1 file

ZFS on Linux — lib/libzfs libzfs_import.c

Fixed zdb -e regression for active cacheless pools

zdb -e for active cache-less pools fails:

$ sudo zpool create -o cachefile=none basic mirror sdk sdl
$ sudo zdb -e -b basic
zdb: can't open 'basic': No such file or directory

This is a recent regression introduce by commit c30d8de.

Reviewed-by: Richard Yao <ryao at gentoo.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Don Brady <don.brady at intel.com>
Closes #6059
Delta File
+7 -2 lib/libzfs/libzfs_import.c
+7 -2 1 file

ZFS on Linux — module/zfs zfs_vnops.c

Fix lseek result when dnode is dirty

Fixup commit 66aca24.  We should have equivalent return
values as generic_file_llseek() and advance to end of file.

Reviewed-by: Richard Yao <ryao at gentoo.org>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Tested-by: bunder2015 <omfgbunder at gmail.com>
Signed-off-by: Debabrata Banerjee <dbanerje at akamai.com>
Closes #6050
Closes #6053
Delta File
+7 -3 module/zfs/zfs_vnops.c
+7 -3 1 file

ZFS on Linux — include/sys zil.h txg.h, module/zfs txg.c zil.c

OpenZFS 8063 - verify that we do not attempt to access inactive txg

Authored by: Matthew Ahrens <mahrens at delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim at delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov at delphix.com>
Approved by: Robert Mustacchi <rm at joyent.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Ported-by: George Melikov <mail at gmelikov.ru>

A standard practice in ZFS is to keep track of "per-txg" state. Any of
the 3 active TXG's (open, quiescing, syncing) can have different values
for this state. We should assert that we do not attempt to modify other
(inactive) TXG's.

Porting Notes:
- ASSERTV added to txg_sync_waiting() for unused variable.

OpenZFS-issue: https://www.illumos.org/issues/8063
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/01acb46
Closes #6109
Delta File
+27 -2 module/zfs/txg.c
+1 -11 module/zfs/zil.c
+10 -1 include/sys/zil.h
+4 -4 module/zfs/dsl_pool.c
+5 -2 include/sys/txg.h
+2 -2 module/zfs/spa.c
+4 -4 2 files not shown
+53 -26 8 files

ZFS on Linux — cmd/zpool/zpool.d lsblk

Fix shellcheck warning in pre-baked script

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tony Hutter <hutter2 at llnl.gov>
Closes #6055
Delta File
+1 -1 cmd/zpool/zpool.d/lsblk
+1 -1 1 file

ZFS on Linux — module/zfs vdev_label.c

Correct lock ASSERTs in vdev_label_read/write

The existing assertions in vdev_label_read() and vdev_label_write(),
testing which config locks are held, are incorrect. The assertions
test for locks which exceed what is required for safety.

Both vdev_label_{read,write}() are changed to assert SCL_STATE is held
as RW_READER or RW_WRITER. This is safe because:

Changes to the vdev tree occur under SCL_ALL as RW_WRITER, via
spa_vdev_enter() and spa_vdev_exit().

Changes to vdev state occur under SCL_STATE_ALL as RW_WRITER, via
spa_vdev_state_enter() and spa_vdev_state_exit().

Therefore, the new assertions guarantee that the vdev cannot change
out from under a zio, and I/O to a specified leaf vdev's label is
safe.

Furthermore, this is consistent with the SPA locking discussion in
spa_misc.c, "For any zio operation that takes an explicit vdev_t
argument ... zio_read_phys(), or zio_write_phys() ... SCL_STATE as
reader suffices."

Reviewed-by: Chunwei Chen <david.chen at osnexus.com>

    [3 lines not shown]
Delta File
+6 -6 module/zfs/vdev_label.c
+6 -6 1 file

ZFS on Linux — . Makefile.am zfs-script-config.sh.in, cmd/zpool zpool_main.c zpool_iter.c

Prebaked scripts for zpool status/iostat -c

This patch updates the "zpool status/iostat -c" commands to only run
"pre-baked" scripts from the /etc/zfs/zpool.d directory (or wherever
you install to).  The scripts can only be run from -c as an unprivileged
user (unless the ZPOOL_SCRIPTS_AS_ROOT environment var is
set by root).  This was done to encourage scripts to be written is such
a way that normal users can use them, and to be cautious.  If your
script needs to run a privileged command, consider adding the
appropriate line in /etc/sudoers.  See zpool(8) for an example of how
to do this.

The patch also allows the scripts to output custom column names.  If
the script outputs a line like:

name=value

then "name" is used for the column name, and "value" is its value.
Multiple columns can be specified by outputting multiple lines.  Column
names and values can have spaces.  If the value is empty, a dash (-) is
printed instead.

After all the "name=value" lines are read (if any), zpool will take the
next the next line of output (if any) and print it without a column
header.  After that, no more lines will be processed. This can be

    [10 lines not shown]

ZFS on Linux — cmd/zfs zfs_main.c, man/man8 zfs.8

Documentation fixes for zfs(8) and 'zfs' binary

* bookmarks are not supported when sending all intermediary snaps (-I)
* add missing compressed (-c) option to the 'zfs' help and manpage

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed by: Richard Laager <rlaager at wiktel.com>
Signed-off-by: loli10K <ezomori.nozomu at gmail.com>
Closes #6028
Delta File
+6 -6 man/man8/zfs.8
+2 -2 cmd/zfs/zfs_main.c
+8 -8 2 files

ZFS on Linux — cmd/vdev_id vdev_id

vdev_id: fix failure due to multipath -l bug

Udev may fail to create the expected symbolic links in
/dev/disk/by-vdev on systems with the
device-mapper-multipath-0.4.9-100.el6 package installed. This affects
RHEL 6.9 and possibly other downstream distributions.

That version of the multipath command may incorrectly list a drive
state as "unkown" instead of "running". The issue was introduced
in the patch for https://bugzilla.redhat.com/show_bug.cgi?id=1401769

The vdev_id udev helper uses the state reported by "multipath -l" to
detect an online component disk of a multipath device in order to
resolve its physical slot and enclosure. Changing the command
invocation to "multipath -ll" works around the above issue by causing
multipath to consult additional sources of information to determine
the drive state.

Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Signed-off-by: Ned Bass <bass6 at llnl.gov>
Closes #6039
Delta File
+2 -2 cmd/vdev_id/vdev_id
+2 -2 1 file

ZFS on Linux — cmd/zfs zfs_main.c

Allow bookmark short name in 'zfs bookmark'

This lets users create a bookmark from the command line by its name
only, without the need to specify the dataset path which is extacted
from the snapshot parameter.

These commands are now equivalent:

   zfs bookmark poolname/fs at snap poolname/fs#bookmark
   zfs bookmark @snap poolname/fs#bookmark
   zfs bookmark poolname/fs at snap \#bookmark

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu at gmail.com>
Closes #3665
Closes #6027
Delta File
+19 -3 cmd/zfs/zfs_main.c
+19 -3 1 file