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

ZFS on Linux — cmd/arc_summary arc_summary.py

Ensure arc_size_break is filled in arc_summary.py

Use mfu_size and mru_size pulled from the arcstats
kstat file to calculate the mfu and mru percentages
for arc size breakdown.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Richard Elling <Richard.Elling at RichardElling.com>
Reviewed-by: AndCycle <andcycle at andcycle.idv.tw>
Signed-off-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Closes #5526
Closes #6770
Delta File
+10 -22 cmd/arc_summary/arc_summary.py
+10 -22 1 file

ZFS on Linux — cmd/arcstat arcstat.py, tests/test-runner/bin test-runner.py

Correct flake8 errors after STYLE builder update

Fix new flake8 errors related to bare excepts and ambiguous
variable names due to a STYLE builder update.

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

ZFS on Linux — tests/runfiles linux.run, tests/zfs-tests/include libtest.shlib

ZTS: Add auto-spare tests

The ZED is expected to automatically kick in a hot spare device
when there's one available in the pool and a sufficient number of
read errors have been encountered.  Use zinject to simulate the
failure condition and verify the hot spare is used.

auto_spare_001_pos.ksh: read IO errors, the vdev is FAULTED
auto_spare_002_pos.ksh: read CHECKSUM errors, the vdev is DEGRADE

Reviewed by: Richard Elling <Richard.Elling at RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: David Quigley <david.quigley at intel.com>
Closes #6280

ZFS on Linux — cmd/zpool zpool_vdev.c

Use ashift=12 by default on SSDSC2BW48 disks

Currently the 480GB models of this disk do not use ashift=12 by
default.  SSDSC2BW48 is also optimized for 4k blocks.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: adisbladis <adis at blad.is>
Closes #6774
Delta File
+1 -0 cmd/zpool/zpool_vdev.c
+1 -0 1 file

ZFS on Linux — .github CONTRIBUTING.md

Provide commit message format for Coverity defects

Provide details about the commit message format for Coverity defect
fixes submitted.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Closes #6771
Delta File
+45 -11 .github/CONTRIBUTING.md
+45 -11 1 file

ZFS on Linux — include/sys spa.h, include/sys/sysevent eventdefs.h

Emit history events for 'zpool create'

History commands and events were being suppressed for the
'zpool create' command since the history object did not
yet exist.  Create the object earlier so this history
doesn't get lost.

Split the pool_destroy event in to pool_destroy and
pool_export so they may be distinguished.

Updated events_001_pos and events_002_pos test cases.  They
now check for the expected history events and were reworked
to be more reliable.

Reviewed-by: Nathaniel Clark <nathaniel.l.clark at intel.com>
Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6712
Closes #6486

ZFS on Linux — config kernel.m4, module/zfs qat_compress.c

Support integration with new QAT products

Support integration with new QAT products: Intel(R) C62x Chipset,
or Atom(R) C3000 Processor Product Family SoC:
1. Detect new file name in auto-conf.
2. Change MAX_INSTANCES to 48.
3. Change "num_inst" to U16 to clean a build warning.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Weigang Li <weigang.li at intel.com>
Closes #6767
Delta File
+5 -3 module/zfs/qat_compress.c
+2 -2 config/kernel.m4
+7 -5 2 files

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

Add convenience 'zfs_get' functions

Add get functions to match existing ones.

Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: John Ramsden <johnramsden at riseup.net>
Closes #6308
Delta File
+16 -0 lib/libzfs/libzfs_dataset.c
+1 -0 include/libzfs.h
+17 -0 2 files

ZFS on Linux — man/man8 zpool.8, module/zfs spa_config.c

Remove vn_rename and vn_remove dependency

The only place vn_rename and vn_remove are used is when writing
out an updated pool configuration file.  By truncating the file
instead of renaming and removing it we can avoid having to implement
these interfaces entirely.  Functionally an empty cache file is
treated the same as a missing cache file.  This is particularly
advantageous because the Linux kernel has never provided a way
to reliably implement vn_rename and vn_remove.

The cachefile_004_pos.ksh test case was updated to understand
that an empty cache file is the same as a missing one.

The zfs-import-* systemd service files were not updated to use
ConditionFileNotEmpty in place of ConditionPathExists.  This
means that after exporting all pools and rebooting new pools
will not the scanned for on the next boot.  This small change
should not impact normal usage since pools are not exported
as part of a normal shutdown.

Documentation was updated accordingly.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Arkadiusz Bubała <arkadiusz.bubala at open-e.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>

    [2 lines not shown]

ZFS on Linux — module/zfs dmu.c

Fix ASSERT in dmu_free_long_object_raw()

This small patch fixes an issue where dmu_free_long_object_raw()
calls dnode_hold() after freeing the dnode a line above.

Reviewed-by: Jorgen Lundman <lundman at lundman.net>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Closes #6766
Delta File
+4 -3 module/zfs/dmu.c
+4 -3 1 file

ZFS on Linux — .github codecov.yml

Update codecov.io behavior

Update the codecov.yml included in the repository to behave as
originally intended.  This can be refined as needed.

* Always post coverage results to the GitHub PR after two builds
  have been uploaded.  This is the normal case since there will
  be a build uploaded for both kernel and user coverage results.

* Adjust red -> yellow -> green coloring in the web interface.
  Due to the number of unlikely error conditions which are hard
  to force consider 90% coverage an excellent level of coverage.

* Allow a 1% variance in coverage between test runs.  This is
  approximately 10x larger than the typical variance observed
  which leaves us a reasonable margin to prevent false positives.

* Always post a new smaller comment to PRs which does not include
  a file list.  Old coverage reports are removed.

Reviewed by: Prakash Surya <prakash.surya at delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6765
Delta File
+8 -17 .github/codecov.yml
+8 -17 1 file

ZFS on Linux — cmd/zpool zpool_main.c

Fix coverity defects: CID 161388

CID 161388: Resource Leak (REASOURCE_LEAK)

Jump to errout so that file descriptor gets closed before returning
from function.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tobin C. Harding <me at tobin.cc>
Closes #6755
Delta File
+4 -2 cmd/zpool/zpool_main.c
+4 -2 1 file

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

Fix coverity defects: 147480, 147584

CID 147480: Logically dead code (DEADCODE)

Remove non-null check and subsequent function call. Add ASSERT to future
proof the code.

usage label is only jumped to before `zhp` is initialized.

CID 147584: Out-of-bounds access (OVERRUN)

Subtract length of current string from buffer length for `size` argument
to `snprintf`.

Starting address for the write is the start of the buffer + the current
string length. We need to subtract this string length else risk a buffer
overflow.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tobin C. Harding <me at tobin.cc>
Closes #6745
Delta File
+4 -4 cmd/zdb/zdb.c
+1 -2 cmd/zfs/zfs_main.c
+5 -6 2 files

ZFS on Linux — . Makefile.am, config deb.am

Add DKMS package on Debian-based distributions

* config/deb.am: Enable building DKMS packages for Debian
* rpm/generic/zfs-dkms.spec.in: Adjust spec to be Debian-compatible
  * Condition kernel-devel Req to RPM distros
  * Adjust the DKMS Req to have a minimum of a version only
  * Ensure that --rpm_safe_upgrade isn't used on non-RPM distros
* config/deb.am: Drop CONFIG_KERNEL and CONFIG_USER guards
* Makefile.am: Add pkg-dkms target

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Neal Gompa <ngompa at datto.com>
Closes #6044
Closes #6731
Delta File
+10 -5 config/deb.am
+8 -2 rpm/generic/zfs-dkms.spec.in
+1 -0 Makefile.am
+19 -7 3 files

ZFS on Linux — . Makefile.am, config deb.am

Add DKMS package on Debian-based distributions

* config/deb.am: Enable building DKMS packages for Debian
* rpm/generic/zfs-dkms.spec.in: Adjust spec to be Debian-compatible
  * Condition kernel-devel Req to RPM distros
  * Adjust the DKMS Req to have a minimum of a version only
  * Ensure that --rpm_safe_upgrade isn't used on non-RPM distros
* config/deb.am: Drop CONFIG_KERNEL and CONFIG_USER guards
* Makefile.am: Add pkg-dkms target

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Neal Gompa <ngompa at datto.com>
Closes #6044
Closes #6731
Delta File
+10 -5 config/deb.am
+8 -2 rpm/generic/zfs-dkms.spec.in
+1 -0 Makefile.am
+19 -7 3 files

ZFS on Linux — lib/libzfs libzfs_import.c

Fix function documentation to correctly mirror code

Currently the function documentation states that two strings are
allocated, this is outdated. Only one char ** parameter is passed
into the function now, clearly only a pointer to a single string
is returned and needs to be free'd.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tobin C. Harding <me at tobin.cc>
Closes #6754
Delta File
+1 -1 lib/libzfs/libzfs_import.c
+1 -1 1 file

ZFS on Linux — lib/libzfs libzfs_import.c

Fix function documentation to correctly mirror code

Currently the function documentation states that two strings are
allocated, this is outdated. Only one char ** parameter is passed
into the function now, clearly only a pointer to a single string
is returned and needs to be free'd.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tobin C. Harding <me at tobin.cc>
Closes #6754
Delta File
+1 -1 lib/libzfs/libzfs_import.c
+1 -1 1 file

ZFS on Linux — scripts zloop.sh

Increase default zloop.sh vdev size

The default 128M vdev size used by zloop.sh isn't always large
enough and can result in ENOSPC failures which suspend the pool.
Increase the default size to 512M and provide a -s option which
can be used to specify an alternate size.

This does increase the free space requirements to run zloop.sh.
However, since the vdevs are sparse 4x the space is not required.

Reviewed-by: Don Brady <don.brady at delphix.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6758
Delta File
+5 -3 scripts/zloop.sh
+5 -3 1 file

ZFS on Linux — scripts zloop.sh

Increase default zloop.sh vdev size

The default 128M vdev size used by zloop.sh isn't always large
enough and can result in ENOSPC failures which suspend the pool.
Increase the default size to 512M and provide a -s option which
can be used to specify an alternate size.

This does increase the free space requirements to run zloop.sh.
However, since the vdevs are sparse 4x the space is not required.

Reviewed-by: Don Brady <don.brady at delphix.com>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6758
Delta File
+5 -3 scripts/zloop.sh
+5 -3 1 file

ZFS on Linux — include/sys dsl_dataset.h

Post-Encryption Followup

This PR includes fixes for bugs and documentation issues found
after the encryption patch was merged and general code improvements
for long-term maintainability.

Reviewed-by: Jorgen Lundman <lundman at lundman.net>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tom Caputi <tcaputi at datto.com>
Issue #6526
Closes #6639
Closes #6703
Cloese #6706
Closes #6714
Closes #6595
∈ Damian Wojsław - cdc15a76 - 2017-10-13 00:10:38
Typo in dsl_dataset.h

The parameters dsl_dataset_t *os in function prototype should be
renamed to dsl_dataset_t *ds.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Damian Wojsław <damian at wojslaw.pl>
Closes #6756
Closes #6273
Delta File
+3 -3 include/sys/dsl_dataset.h
+3 -3 1 file

ZFS on Linux — include/sys dsl_dataset.h

Typo in dsl_dataset.h

The parameters dsl_dataset_t *os in function prototype should be
renamed to dsl_dataset_t *ds.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Damian Wojsław <damian at wojslaw.pl>
Closes #6756
Closes #6273
Delta File
+3 -3 include/sys/dsl_dataset.h
+3 -3 1 file

ZFS on Linux — include/sys dsl_dataset.h

Typo in dsl_dataset.h

The parameters dsl_dataset_t *os in function prototype should be
renamed to dsl_dataset_t *ds.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Damian Wojsław <damian at wojslaw.pl>
Closes #6756
Closes #6273
Delta File
+3 -3 include/sys/dsl_dataset.h
+3 -3 1 file

ZFS on Linux — lib/libspl Makefile.am, module/icp/algs/sha1 sha1.c

Fixes for SPARC support

The current code base almost compiles on SPARC, but a few fixes are
required for the code to compile (and work efficiently). Code in this
PR comes from OpenZFS project which was initially dropped when porting
the crypto framework.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Pengcheng Xu <i at jsteward.moe>
Closes #6733
Closes #6738
Closes #6750

ZFS on Linux — contrib/initramfs/hooks zfs

Fixes for SPARC support

The current code base almost compiles on SPARC, but a few fixes are
required for the code to compile (and work efficiently). Code in this
PR comes from OpenZFS project which was initially dropped when porting
the crypto framework.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Pengcheng Xu <i at jsteward.moe>
Closes #6733
Closes #6738
Closes #6750
∈ Antonio Russo - 085b501f - 2017-10-12 16:39:45
Explicitly depend on icp module in initramfs hook

Automatic dependency resolution is unreliable on many systems.
Follow suit with existing code, and explicitly include icp
in module dependencies.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Antonio Russo <antonio.e.russo at gmail.com>
Closes #6751
Delta File
+1 -1 contrib/initramfs/hooks/zfs
+1 -1 1 file

ZFS on Linux — contrib/initramfs/hooks zfs

Explicitly depend on icp module in initramfs hook

Automatic dependency resolution is unreliable on many systems.
Follow suit with existing code, and explicitly include icp
in module dependencies.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Antonio Russo <antonio.e.russo at gmail.com>
Closes #6751
Delta File
+1 -1 contrib/initramfs/hooks/zfs
+1 -1 1 file

ZFS on Linux — contrib/initramfs/hooks zfs

Explicitly depend on icp module in initramfs hook

Automatic dependency resolution is unreliable on many systems.
Follow suit with existing code, and explicitly include icp
in module dependencies.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Antonio Russo <antonio.e.russo at gmail.com>
Closes #6751
Delta File
+1 -1 contrib/initramfs/hooks/zfs
+1 -1 1 file

ZFS on Linux — lib/libspl Makefile.am

Remove useless DEFAULT_INCLUDES in AM_CCASFLAGS

CPPASCOMPILE and LTCPPASCOMPILE all include DEFAULT_INCLUDES,
hence it's unnecessary to add the includes again.

Signed-off-by: Pengcheng Xu <i at jsteward.moe>
Delta File
+0 -1 lib/libspl/Makefile.am
+0 -1 1 file

ZFS on Linux — contrib/initramfs/scripts zfs, contrib/initramfs/scripts/local-top zfs

Fix boot from ZFS issues

* Correct ZFS snapshot listing
* Disable "lvm is not available" message on quiet boot

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alar Aun <spamtoaun at gmail.com>
Closes #6700
Closes #6747

ZFS on Linux — contrib/initramfs/scripts zfs, contrib/initramfs/scripts/local-top zfs

Fix boot from ZFS issues

* Correct ZFS snapshot listing
* Disable "lvm is not available" message on quiet boot

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alar Aun <spamtoaun at gmail.com>
Closes #6700
Closes #6747

ZFS on Linux — tests/zfs-tests/include libtest.shlib

Fix chattr/cleanup failure

The chattr cleanup step may fail to delete the user if there is still
an active process running as that user.  Retry the userdel when this
occurs to eliminate spurious false positves.

  ERROR: userdel quser1 exited 8
  userdel: user quser1 is currently used by process 26814

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

ZFS on Linux — tests/zfs-tests/include libtest.shlib

Fix chattr/cleanup failure

The chattr cleanup step may fail to delete the user if there is still
an active process running as that user.  Retry the userdel when this
occurs to eliminate spurious false positves.

  ERROR: userdel quser1 exited 8
  userdel: user quser1 is currently used by process 26814

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

ZFS on Linux — module/zfs metaslab.c

Relax ASSERT for #6526

This patch resolves a minor issue where an ASSERT in
metaslab_passivate() that only applies to non weight-based
metaslabs was erroneously applied to all metaslabs.

Signed-off-by: Tom Caputi <tcaputi at datto.com>
Delta File
+2 -1 module/zfs/metaslab.c
+2 -1 1 file

ZFS on Linux — lib/libspl Makefile.am

Fix libspl assembler flags to respect cpu type

It's important to respect the user's CFLAGS as mismatched -mcpu
will directly result in the assembler not able to produce correct
code. Fixes #6733.

Signed-off-by: Pengcheng Xu <i at jsteward.moe>
Delta File
+2 -1 lib/libspl/Makefile.am
+2 -1 1 file

ZFS on Linux — module/icp/algs/sha1 sha1.c

SPARC optimizations for Encode()

Normally a SPARC processor runs in big endian mode. Save the extra labor
needed for little endian machines when the target is a big endian one
(sparc).

Signed-off-by: Pengcheng Xu <i at jsteward.moe>
Delta File
+17 -5 module/icp/algs/sha1/sha1.c
+17 -5 1 file

ZFS on Linux — module/icp/algs/sha1 sha1.c

SPARC optimizations for SHA1Transform()

Passing arguments explicitly into SHA1Transform() increases the number of
registers abailable to the compiler, hence leaving more local and out registers
available. The missing symbol of sha1_consts[], which prevents compiling on
SPARC, is added back, which speeds up the process of utilizing the relative
constants.
This should fix #6738.

Signed-off-by: Pengcheng Xu <i at jsteward.moe>
Delta File
+164 -1 module/icp/algs/sha1/sha1.c
+164 -1 1 file

ZFS on Linux — module/zfs sa.c

Fix coverity defects: CID 147474

CID 147474: Logically dead code (DEADCODE)

Remove ternary operator and return `error` directly.

Currently return value is derived from a ternary operator. The
conditional is always true. The ternary operator is therefore
redundant i.e dead code.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tobin C. Harding <me at tobin.cc>
Closes #6723
Delta File
+2 -1 module/zfs/sa.c
+2 -1 1 file

ZFS on Linux — lib/libzfs libzfs_sendrecv.c libzfs_iter.c, tests/zfs-tests/tests/functional/rsend rsend.kshlib rsend_019_pos.ksh

Fix intra-pool resumable 'zfs send -t <token>'

Because resuming from a token requires "guid" -> "snapshot" mapping
we have to walk the whole dataset hierarchy to find the right snapshot
to send; when both source and destination exists, for an incremental
resumable stream, libzfs gets confused and picks up the wrong snapshot
to send from: this results in attempting to send

   "destination at snap1 -> source at snap2"

instead of

   "source at snap1 -> source at snap2"

which fails with a "Invalid cross-device link" error (EXDEV).

Fix this by adjusting the logic behind dataset traversal in
zfs_iter_children() to pick the right snapshot to send from.

Additionally update dry-run 'zfs send -t' to print its output to
stderr: this is consistent with other dry-run commands.

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

    [3 lines not shown]

ZFS on Linux — lib/libzfs libzfs_sendrecv.c libzfs_iter.c, tests/zfs-tests/tests/functional/rsend rsend.kshlib rsend_019_pos.ksh

Fix intra-pool resumable 'zfs send -t <token>'

Because resuming from a token requires "guid" -> "snapshot" mapping
we have to walk the whole dataset hierarchy to find the right snapshot
to send; when both source and destination exists, for an incremental
resumable stream, libzfs gets confused and picks up the wrong snapshot
to send from: this results in attempting to send

   "destination at snap1 -> source at snap2"

instead of

   "source at snap1 -> source at snap2"

which fails with a "Invalid cross-device link" error (EXDEV).

Fix this by adjusting the logic behind dataset traversal in
zfs_iter_children() to pick the right snapshot to send from.

Additionally update dry-run 'zfs send -t' to print its output to
stderr: this is consistent with other dry-run commands.

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

    [3 lines not shown]

ZFS on Linux — module/zfs arc.c, tests/zfs-tests/tests/functional/cli_root/zpool_clear zpool_clear_001_pos.ksh

Fix ARC behavior on 32-bit systems

With the addition of the ABD changes consumption of the virtual
address space has been greatly reduced.  This exposed an issue on
CONFIG_HIGHMEM systems where free memory was being calculated
incorrectly.  Functionally this didn't cause any major problems
prior to ABD because a lack of available virtual address space
was used as an indicator of low memory.

This patch makes the following changes to address the issue and
in the process realigns the code further with OpenZFS.  There
are no substantive changes in behavior for 64-bit systems.

* Added CONFIG_HIGHMEM case to the arc_all_memory() and
  arc_free_memory() functions to only consider low memory pages
  on CONFIG_HIGHMEM systems.

* The arc_free_memory() function was updated to return bytes
  instead of pages to be consistent with the other helper
  functions.  In user space we make up some reasonable values
  since currently only testing is performed in this context.

* Adds three new values to the arcstats kstat to provide visibility
  in to the ARC's assessment of the memory situation:
  memory_all_bytes, memory_free_bytes, and memory_available_bytes.

    [14 lines not shown]

ZFS on Linux — module/zfs arc.c, tests/zfs-tests/tests/functional/cli_root/zpool_clear zpool_clear_001_pos.ksh

Fix ARC behavior on 32-bit systems

With the addition of the ABD changes consumption of the virtual
address space has been greatly reduced.  This exposed an issue on
CONFIG_HIGHMEM systems where free memory was being calculated
incorrectly.  Functionally this didn't cause any major problems
prior to ABD because a lack of available virtual address space
was used as an indicator of low memory.

This patch makes the following changes to address the issue and
in the process realigns the code further with OpenZFS.  There
are no substantive changes in behavior for 64-bit systems.

* Added CONFIG_HIGHMEM case to the arc_all_memory() and
  arc_free_memory() functions to only consider low memory pages
  on CONFIG_HIGHMEM systems.

* The arc_free_memory() function was updated to return bytes
  instead of pages to be consistent with the other helper
  functions.  In user space we make up some reasonable values
  since currently only testing is performed in this context.

* Adds three new values to the arcstats kstat to provide visibility
  in to the ARC's assessment of the memory situation:
  memory_all_bytes, memory_free_bytes, and memory_available_bytes.

    [14 lines not shown]

ZFS on Linux — contrib/dracut/90zfs module-setup.sh.in

Fix inclusion of libgcc_s.so on Void

On Void Linux (x86_64 musl) libgcc_s.so is located in "/usr/lib"
so it is not found by dracut and it produces an error.

Add a simple additional path check for "/usr/lib/libgcc_s.so*"
and install it in the initramfs.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: privb0x23 <privb0x23 at users.noreply.github.com>
Closes #6715

ZFS on Linux — contrib/dracut/90zfs module-setup.sh.in

Fix inclusion of libgcc_s.so on Void

On Void Linux (x86_64 musl) libgcc_s.so is located in "/usr/lib"
so it is not found by dracut and it produces an error.

Add a simple additional path check for "/usr/lib/libgcc_s.so*"
and install it in the initramfs.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: privb0x23 <privb0x23 at users.noreply.github.com>
Closes #6715

ZFS on Linux — module/zfs abd.c

Fix abdstats kstat on 32-bit systems

When decrementing the struct_size and scatter_chunk_waste kstats
the value needs to be cast to an int on 32-bit systems.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6721
Delta File
+2 -2 module/zfs/abd.c
+2 -2 1 file

ZFS on Linux — cmd/zed zed_conf.c

Use bitwise '&' instead of logical '&&'

Make two instances of the same change. Change bitwise AND (&) to logical
AND (&&).

Currently the code uses a bitwise AND between two boolean values.

In the first instance;

The first operand is a flag that has been bitwise combined with a bit
mask to get a boolean value as to whether a file has group write
permissions set.

The second operand used is a struct member that is intended as a
boolean flag not a bit mask.

In the second instance the argument is the same except with world write
permissions instead of group write (S_IWOTH, S_IWGRP).

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Chris Dunlop <chris at onthe.net.au>
Signed-off-by: Tobin C. Harding <me at tobin.cc>
Closes #6684
Closes #6722
Delta File
+2 -2 cmd/zed/zed_conf.c
+2 -2 1 file

ZFS on Linux — cmd/zed zed_conf.c

Use bitwise '&' instead of logical '&&'

Make two instances of the same change. Change bitwise AND (&) to logical
AND (&&).

Currently the code uses a bitwise AND between two boolean values.

In the first instance;

The first operand is a flag that has been bitwise combined with a bit
mask to get a boolean value as to whether a file has group write
permissions set.

The second operand used is a struct member that is intended as a
boolean flag not a bit mask.

In the second instance the argument is the same except with world write
permissions instead of group write (S_IWOTH, S_IWGRP).

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Chris Dunlop <chris at onthe.net.au>
Signed-off-by: Tobin C. Harding <me at tobin.cc>
Closes #6684
Closes #6722
Delta File
+2 -2 cmd/zed/zed_conf.c
+2 -2 1 file

ZFS on Linux — module/zfs zfs_vnops.c

Remove unnecessary equality check

Currently `if` statement includes an assignment (from a function return
value) and a equality check. The parenthesis are in the incorrect place,
currently the code clobbers the function return value because of this.

We can fix this by simplifying the `if` statement.

`if (foo != 0)`

can be more succinctly expressed as

`if (foo)`

Remove the equality check, add parenthesis to correct the statement.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Chris Dunlop <chris at onthe.net.au>
Signed-off-by: Tobin C. Harding <me at tobin.cc>
Closes #6685
Close #6719
Delta File
+1 -1 module/zfs/zfs_vnops.c
+1 -1 1 file

ZFS on Linux — module/zfs zfs_vnops.c

Remove unnecessary equality check

Currently `if` statement includes an assignment (from a function return
value) and a equality check. The parenthesis are in the incorrect place,
currently the code clobbers the function return value because of this.

We can fix this by simplifying the `if` statement.

`if (foo != 0)`

can be more succinctly expressed as

`if (foo)`

Remove the equality check, add parenthesis to correct the statement.

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Chris Dunlop <chris at onthe.net.au>
Signed-off-by: Tobin C. Harding <me at tobin.cc>
Closes #6685
Close #6719
Delta File
+1 -1 module/zfs/zfs_vnops.c
+1 -1 1 file

ZFS on Linux — module/zfs vdev_label.c

Use linear abd in vdev_copy_uberblocks()

The vdev_copy_uberblocks() function should use abd_alloc_linear() to
allocate ub_abd, because abd_to_buf(ub_abd)) is used later.

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: Isaac Huang <he.huang at intel.com>
Closes #6718
Closes #6713
Delta File
+1 -1 module/zfs/vdev_label.c
+1 -1 1 file

ZFS on Linux — module/zfs vdev_label.c

Use linear abd in vdev_copy_uberblocks()

The vdev_copy_uberblocks() function should use abd_alloc_linear() to
allocate ub_abd, because abd_to_buf(ub_abd)) is used later.

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: Isaac Huang <he.huang at intel.com>
Closes #6718
Closes #6713
Delta File
+1 -1 module/zfs/vdev_label.c
+1 -1 1 file

ZFS on Linux — include/sys avl.h, module/avl avl.c

Remove dead code from AVL tree

The avl_update_* functions are never used by ZFS and are therefore
being removed.  They're barely even used in Illumos.  Additionally,
simplify avl_add() by using a VERIFY which produces exactly the same
behavior under Linux.

Reviewed-by: George Melikov <mail at gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2 at llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Closes #6716
Delta File
+4 -71 module/avl/avl.c
+0 -11 include/sys/avl.h
+4 -82 2 files