Displaying 1 50 of 4,457 commits (0.014s)

ZFS on Linux — module/zfs zvol.c

Fix ida leak in zvol_create_minor_impl

Added missing ida_simple_remove() in the error handling path.

Reviewed-by: Chunwei Chen <david.chen at osnexus.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Boris Protopopov <boris.protopopov at actifio.com>
Closes #6159
Closes #6172
Delta File
+7 -0 module/zfs/zvol.c
+7 -0 1 file

ZFS on Linux — module/zfs bpobj.c

Don't dirty bpobj if it has no entries

In certain cases (dsl_scan_sync() is one), we may end up calling
bpobj_iterate() on an empty bpobj. Even though we don't end up
modifying the bpobj it still gets dirtied, causing unneeded writes
to the pool.

This patch adds an early bail from bpobj_iterate_impl() if bpobj
is empty to prevent unneeded writes.

Reviewed-by: George Melikov <mail at gmelikov.ru>
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 #6164
Delta File
+4 -0 module/zfs/bpobj.c
+4 -0 1 file

ZFS on Linux — module/zfs zfs_ioctl.c zvol.c, tests/runfiles linux.run

Revert "Fix "snapdev" property inheritance behaviour"

This reverts commit 959f56b99366c8727647b5b19fb3d47555c96cf3.
An issue was uncovered by the new zvol_misc_snapdev test case
which needs to be investigated and resolved.

Reviewed-by: loli10K <ezomori.nozomu at gmail.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6174
Issue #6131

ZFS on Linux — module/zfs zfs_ioctl.c zvol.c, tests/runfiles linux.run

Fix "snapdev" property inheritance behaviour

When inheriting the "snapdev" property to we don't always call
zfs_prop_set_special(): this prevents device nodes from being created in
certain situations. Because "snapdev" is the only *special* property
that is also inheritable we need to call zfs_prop_set_special() even
when we're not reverting it to the received value ('zfs inherit -S').

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

ZFS on Linux — include/linux vfs_compat.h, module/zfs zfs_vfsops.c

Linux 4.12 compat: fix super_setup_bdi_name() call

Provide a format parameter to super_setup_bdi_name() so we don't
create duplicate names in '/devices/virtual/bdi' sysfs namespace which
would prevent us from mounting more than one ZFS filesystem at a time.

Reviewed-by: Chunwei Chen <david.chen at osnexus.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu at gmail.com>
Closes #6147

ZFS on Linux — config kernel.m4

config: allow --with-linux without --with-linux-obj

Don't use `uname -r` to determine kernel build directory when the user
specified kernel source with --with-linux. Otherwise, the user is forced
to use --with-linux-obj even if they are the same directory, which is
very counterintuitive.

Signed-off-by: Chunwei Chen <david.chen at osnexus.com>
Requires-spl: refs/pull/617/head
Delta File
+2 -1 config/kernel.m4
+2 -1 1 file

ZFS on Linux — . .gitignore, module .gitignore

Improve gitignore

Ignore .*.d and exclude Makefile.in in module/
Also, ignore *.patch and *.orig files

Signed-off-by: Chunwei Chen <david.chen at osnexus.com>
Delta File
+3 -0 module/.gitignore
+2 -0 .gitignore
+5 -0 2 files

ZFS on Linux — tests/zfs-tests/tests/functional/cli_root/zpool_get zpool_get.cfg

OpenZFS 8077 - zfs-tests suite fails zpool_get_002_pos

Authored by: Yuri Pankov <yuri.pankov at nexenta.com>
Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Reviewed by: John Kennedy <jwk404 at gmail.com>
Approved by: Richard Lowe <richlowe at richlowe.net>
Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Ported-by: bunder2015 <omfgbunder at gmail.com>

Porting Notes:
* Also corrected a quoting mistake found in our copy

OpenZFS-issue: https://www.illumos.org/issues/8077
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/481467d
Closes #6163

ZFS on Linux — tests/zfs-tests/tests/functional/rootpool rootpool_002_neg.ksh

OpenZFS 8076 - zfs-tests suite fails rootpool_002_neg

Authored by: Yuri Pankov <yuri.pankov at nexenta.com>
Reviewed by: John Kennedy <jwk404 at gmail.com>
Reviewed by: Prakash Surya <prakash.surya at delphix.com>
Approved by: Richard Lowe <richlowe at richlowe.net>
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/8076
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ab3407e
Closes #6162

ZFS on Linux — tests/zfs-tests/tests/functional/cli_root/zpool_destroy zpool_destroy_002_pos.ksh, tests/zfs-tests/tests/functional/xattr xattr_009_neg.ksh

OpenZFS 8071 - zfs-tests: 7290 missed some cases

Authored by: Yuri Pankov <yuri.pankov at nexenta.com>
Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Reviewed by: John Kennedy <jwk404 at gmail.com>
Approved by: Richard Lowe <richlowe at richlowe.net>
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/8071
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/e84991e
Closes #6161

ZFS on Linux — module/zfs dbuf.c dsl_scan.c

OpenZFS 8070 - Add some ZFS comments

Authored by: Alan Somers <asomers at gmail.com>
Reviewed by: Yuri Pankov <yuri.pankov at gmail.com>
Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Approved by: Robert Mustacchi <rm at joyent.com>
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/8070
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/40713f2
Closes #6160
Delta File
+5 -0 module/zfs/dbuf.c
+2 -0 module/zfs/dsl_scan.c
+7 -0 2 files

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 — tests/zfs-tests/tests/functional/cli_root/zfs_promote zfs_promote_006_neg.ksh, tests/zfs-tests/tests/functional/cli_user/misc misc.cfg zfs_get_001_neg.ksh

OpenZFS 8072 - zfs-tests: several test cases incorrectly spell TESTPOOL

Authored by: Yuri Pankov <yuri.pankov at nexenta.com>
Reviewed by: Matthew Ahrens <mahrens at delphix.com>
Reviewed by: John Kennedy <jwk404 at gmail.com>
Approved by: Richard Lowe <richlowe at richlowe.net>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Ported-by: Giuseppe Di Natale <dinatale2 at llnl.gov>

OpenZFS-issue: https://www.illumos.org/issues/8072
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/56e4733
Closes #6137

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