Package Details: zfs-dkms 2.1.1-1

Git Clone URL: https://aur.archlinux.org/zfs-dkms.git (read-only, click to copy)
Package Base: zfs-dkms
Description: Kernel modules for the Zettabyte File System.
Upstream URL: https://zfsonlinux.org/
Licenses: CDDL
Conflicts: spl-dkms
Provides: SPL-MODULE=2.1.1, ZFS-MODULE=2.1.1, spl-dkms, zfs
Replaces: spl-dkms
Submitter: isiachi
Maintainer: eschwartz (jonathon)
Last Packager: jonathon
Votes: 120
Popularity: 4.15
First Submitted: 2015-08-31 12:01
Last Updated: 2021-10-01 10:41

Required by (18)

Sources (3)

Latest Comments

« First ‹ Previous ... 4 5 6 7 8 9 10 11 12 13 14 ... Next › Last »

borgman_jeremy commented on 2020-08-17 15:04

This build fails with the 5.8 kernel due to the vmalloc function changing. Can we merge in the patch suggested by @FrederickZh

FrederickZh commented on 2020-08-15 13:41

Copied Linux 5.8 patch from NixOS:

diff --git a/0003-fix-5.8-build.patch b/0003-fix-5.8-build.patch
new file mode 100644
index 0000000..780ce83
--- /dev/null
+++ b/0003-fix-5.8-build.patch
@@ -0,0 +1,154 @@
+From 6cc95288ccea12ad7b67b2b5b3997dfad8e5b5c9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Michael=20Niew=C3=B6hner?=
+ <c0d3z3r0@users.noreply.github.com>
+Date: Tue, 9 Jun 2020 01:32:02 +0200
+Subject: [PATCH] BACKPORT: Linux 5.8 compat: __vmalloc()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The `pgprot` argument has been removed from `__vmalloc` in Linux 5.8,
+being `PAGE_KERNEL` always now [1].
+
+Detect this during configure and define a wrapper for older kernels.
+
+[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/mm/vmalloc.c?h=next-20200605&id=88dca4ca5a93d2c09e5bbc6a62fbfc3af83c4fca
+
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Co-authored-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
+Co-authored-by: Michael Niewöhner <foss@mniewoehner.de>
+Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
+Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
+Closes #10422
+---
+ config/kernel-kmem.m4       | 26 ++++++++++++++++++++++++++
+ config/kernel.m4            |  2 ++
+ include/spl/sys/kmem.h      |  9 +++++++++
+ module/spl/spl-kmem-cache.c |  4 ++--
+ module/spl/spl-kmem.c       |  9 ++++-----
+ 5 files changed, 43 insertions(+), 7 deletions(-)
+
+diff --git a/config/kernel-kmem.m4 b/config/kernel-kmem.m4
+index cc055e530..f1c0d2412 100644
+--- a/config/kernel-kmem.m4
++++ b/config/kernel-kmem.m4
+@@ -56,3 +56,29 @@ AC_DEFUN([SPL_AC_DEBUG_KMEM_TRACKING], [
+   AC_MSG_CHECKING([whether detailed kmem tracking is enabled])
+   AC_MSG_RESULT([$enable_debug_kmem_tracking])
+ ])
++
++dnl #
++dnl # 5.8 API,
++dnl # __vmalloc PAGE_KERNEL removal
++dnl #
++AC_DEFUN([ZFS_AC_KERNEL_SRC_VMALLOC_PAGE_KERNEL], [
++  ZFS_LINUX_TEST_SRC([__vmalloc], [
++      #include <linux/mm.h>
++      #include <linux/vmalloc.h>
++  ],[
++      void *p __attribute__ ((unused));
++
++      p = __vmalloc(0, GFP_KERNEL, PAGE_KERNEL);
++  ])
++])
++
++AC_DEFUN([ZFS_AC_KERNEL_VMALLOC_PAGE_KERNEL], [
++  AC_MSG_CHECKING([whether __vmalloc(ptr, flags, pageflags) is available])
++  ZFS_LINUX_TEST_RESULT([__vmalloc], [
++      AC_MSG_RESULT(yes)
++      AC_DEFINE(HAVE_VMALLOC_PAGE_KERNEL, 1, [__vmalloc page flags exists])
++  ],[
++      AC_MSG_RESULT(no)
++  ])
++])
++-
+diff --git a/config/kernel.m4 b/config/kernel.m4
+index b67fcef8c..23edfdcd8 100644
+--- a/config/kernel.m4
++++ b/config/kernel.m4
+@@ -45,6 +45,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
+   ZFS_AC_KERNEL_SRC_SCHED
+   ZFS_AC_KERNEL_SRC_USLEEP_RANGE
+   ZFS_AC_KERNEL_SRC_KMEM_CACHE
++  ZFS_AC_KERNEL_SRC_VMALLOC_PAGE_KERNEL
+   ZFS_AC_KERNEL_SRC_WAIT
+   ZFS_AC_KERNEL_SRC_INODE_TIMES
+   ZFS_AC_KERNEL_SRC_INODE_LOCK
+@@ -163,6 +164,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
+   ZFS_AC_KERNEL_SCHED
+   ZFS_AC_KERNEL_USLEEP_RANGE
+   ZFS_AC_KERNEL_KMEM_CACHE
++  ZFS_AC_KERNEL_VMALLOC_PAGE_KERNEL
+   ZFS_AC_KERNEL_WAIT
+   ZFS_AC_KERNEL_INODE_TIMES
+   ZFS_AC_KERNEL_INODE_LOCK
+diff --git a/include/spl/sys/kmem.h b/include/spl/sys/kmem.h
+index 72d3a7765..ca15bfe7f 100644
+--- a/include/spl/sys/kmem.h
++++ b/include/spl/sys/kmem.h
+@@ -169,6 +169,15 @@ extern void *spl_kmem_alloc(size_t sz, int fl, const char *func, int line);
+ extern void *spl_kmem_zalloc(size_t sz, int fl, const char *func, int line);
+ extern void spl_kmem_free(const void *ptr, size_t sz);
+ 
++/*
++ * 5.8 API change, pgprot_t argument removed.
++ */
++#ifdef HAVE_VMALLOC_PAGE_KERNEL
++#define   spl_vmalloc(size, flags)    __vmalloc(size, flags, PAGE_KERNEL)
++#else
++#define   spl_vmalloc(size, flags)    __vmalloc(size, flags)
++#endif
++
+ /*
+  * The following functions are only available for internal use.
+  */
+diff --git a/module/spl/spl-kmem-cache.c b/module/spl/spl-kmem-cache.c
+index d71b4b348..4866b2993 100644
+--- a/module/spl/spl-kmem-cache.c
++++ b/module/spl/spl-kmem-cache.c
+@@ -203,7 +203,7 @@ kv_alloc(spl_kmem_cache_t *skc, int size, int flags)
+       ASSERT(ISP2(size));
+       ptr = (void *)__get_free_pages(lflags, get_order(size));
+   } else {
+-      ptr = __vmalloc(size, lflags | __GFP_HIGHMEM, PAGE_KERNEL);
++      ptr = spl_vmalloc(size, lflags | __GFP_HIGHMEM);
+   }
+ 
+   /* Resulting allocated memory will be page aligned */
+@@ -1242,7 +1242,7 @@ spl_cache_grow(spl_kmem_cache_t *skc, int flags, void **obj)
+    * allocation.
+    *
+    * However, this can't be applied to KVM_VMEM due to a bug that
+-   * __vmalloc() doesn't honor gfp flags in page table allocation.
++   * spl_vmalloc() doesn't honor gfp flags in page table allocation.
+    */
+   if (!(skc->skc_flags & KMC_VMEM)) {
+       rc = __spl_cache_grow(skc, flags | KM_NOSLEEP);
+diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c
+index cee69ad43..ca1fc145f 100644
+--- a/module/spl/spl-kmem.c
++++ b/module/spl/spl-kmem.c
+@@ -172,16 +172,15 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
+        * kmem_zalloc() callers.
+        *
+        * For vmem_alloc() and vmem_zalloc() callers it is permissible
+-       * to use __vmalloc().  However, in general use of __vmalloc()
+-       * is strongly discouraged because a global lock must be
+-       * acquired.  Contention on this lock can significantly
++       * to use spl_vmalloc().  However, in general use of
++       * spl_vmalloc() is strongly discouraged because a global lock
++       * must be acquired.  Contention on this lock can significantly
+        * impact performance so frequently manipulating the virtual
+        * address space is strongly discouraged.
+        */
+       if ((size > spl_kmem_alloc_max) || use_vmem) {
+           if (flags & KM_VMEM) {
+-              ptr = __vmalloc(size, lflags | __GFP_HIGHMEM,
+-                  PAGE_KERNEL);
++              ptr = spl_vmalloc(size, lflags | __GFP_HIGHMEM);
+           } else {
+               return (NULL);
+           }
+-- 
+2.25.1
+
diff --git a/0003-kernel-kmem.m4 b/0003-kernel-kmem.m4
new file mode 100644
index 0000000..cc055e5
--- /dev/null
+++ b/0003-kernel-kmem.m4
@@ -0,0 +1,58 @@
+dnl #
+dnl # Enabled by default it provides a minimal level of memory tracking.
+dnl # A total count of bytes allocated is kept for each alloc and free.
+dnl # Then at module unload time a report to the console will be printed
+dnl # if memory was leaked.
+dnl #
+AC_DEFUN([SPL_AC_DEBUG_KMEM], [
+   AC_ARG_ENABLE([debug-kmem],
+       [AS_HELP_STRING([--enable-debug-kmem],
+       [Enable basic kmem accounting @<:@default=no@:>@])],
+       [],
+       [enable_debug_kmem=no])
+
+   AS_IF([test "x$enable_debug_kmem" = xyes],
+   [
+       KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM"
+       DEBUG_KMEM="_with_debug_kmem"
+       AC_DEFINE([DEBUG_KMEM], [1],
+       [Define to 1 to enable basic kmem accounting])
+   ], [
+       DEBUG_KMEM="_without_debug_kmem"
+   ])
+
+   AC_SUBST(DEBUG_KMEM)
+   AC_MSG_CHECKING([whether basic kmem accounting is enabled])
+   AC_MSG_RESULT([$enable_debug_kmem])
+])
+
+dnl #
+dnl # Disabled by default it provides detailed memory tracking.  This
+dnl # feature also requires --enable-debug-kmem to be set.  When enabled
+dnl # not only will total bytes be tracked but also the location of every
+dnl # alloc and free.  When the SPL module is unloaded a list of all leaked
+dnl # addresses and where they were allocated will be dumped to the console.
+dnl # Enabling this feature has a significant impact on performance but it
+dnl # makes finding memory leaks pretty straight forward.
+dnl #
+AC_DEFUN([SPL_AC_DEBUG_KMEM_TRACKING], [
+   AC_ARG_ENABLE([debug-kmem-tracking],
+       [AS_HELP_STRING([--enable-debug-kmem-tracking],
+       [Enable detailed kmem tracking  @<:@default=no@:>@])],
+       [],
+       [enable_debug_kmem_tracking=no])
+
+   AS_IF([test "x$enable_debug_kmem_tracking" = xyes],
+   [
+       KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM_TRACKING"
+       DEBUG_KMEM_TRACKING="_with_debug_kmem_tracking"
+       AC_DEFINE([DEBUG_KMEM_TRACKING], [1],
+       [Define to 1 to enable detailed kmem tracking])
+   ], [
+       DEBUG_KMEM_TRACKING="_without_debug_kmem_tracking"
+   ])
+
+   AC_SUBST(DEBUG_KMEM_TRACKING)
+   AC_MSG_CHECKING([whether detailed kmem tracking is enabled])
+   AC_MSG_RESULT([$enable_debug_kmem_tracking])
+])
diff --git a/PKGBUILD b/PKGBUILD
index f44d677..4638484 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -15,22 +15,30 @@ provides=("ZFS-MODULE=${pkgver}" "SPL-MODULE=${pkgver}" 'spl-dkms')
 # ambiguous, provided for backwards compat, pls don't use
 provides+=('zfs')
 replaces=('spl-dkms')
 source=("https://github.com/zfsonlinux/zfs/releases/download/zfs-${pkgver}/zfs-${pkgver}.tar.gz"{,.asc}
-        "0001-only-build-the-module-in-dkms.conf.patch")
+        "0001-only-build-the-module-in-dkms.conf.patch"
+        "0003-fix-5.8-build.patch"
+        "0003-kernel-kmem.m4")
 sha256sums=('2b988f5777976f09d08083f6bebf6e67219c4c4c183c1f33033fb7e5e5eacafb'
             'SKIP'
-            '780e590383fb00389c5e02ac15709b7a476d9e07d3c4935ed9eb67c951a88409')
+            '780e590383fb00389c5e02ac15709b7a476d9e07d3c4935ed9eb67c951a88409'
+            '4af22c91cc5ca2db2dd591cefd9b7ad7e7c7aeb35fd7831bcfdfbf3c621ba83b'
+            '666b6a7e83647f3fd815885aa4e36f5eaf0da2d8ff3d7e4fdaae03150c074676')
 b2sums=('776bcd6dfab8825c07d315085e288b29bf543d6957325d5d566b7b78c04505dde9bd25eb6684cb4a1b6a657de8a4e1290d04d2b9079d26d6b834a70f1ec3b569'
         'SKIP'
-        '1fdae935043d979b9241f07f8baa25a9a0367c24c31c84a59dfe8d6b468a523d8f49b68da3c7fd3194db6638f9d7bef046fc5e2669ce25d73c65009c16bf6c50')
+        '1fdae935043d979b9241f07f8baa25a9a0367c24c31c84a59dfe8d6b468a523d8f49b68da3c7fd3194db6638f9d7bef046fc5e2669ce25d73c65009c16bf6c50'
+        '93b60f36747a50d613ee018684ad7191ef5b08e001559d110770a78f280d2d7d591ea996e5cd287bb97bdf6237728d74897eb67d2e99ddcc4e91f8aa3ab9a61b'
+        '6df8980d529a0d5adf4a7dfb33f0838bcf2df5677d7d10d1697e89df7fb38facd009571d0312d19714a0e9e8f8f88efc948d832f78e944e5939fe8caff01bf1a')
 validpgpkeys=('4F3BA9AB6D1F8D683DC2DFB56AD860EED4598027'  # Tony Hutter (GPG key for signing ZFS releases) <hutter2@llnl.gov>
               'C33DF142657ED1F7C328A2960AB9E991C6AF658B') # Brian Behlendorf <behlendorf1@llnl.gov>

 prepare() {
     cd "${srcdir}"/${pkgname%-dkms}-${pkgver}

     patch -p1 -i ../0001-only-build-the-module-in-dkms.conf.patch
+    cp ../0003-kernel-kmem.m4 config/kernel-kmem.m4
+    patch -p1 -i ../0003-fix-5.8-build.patch

     # remove unneeded sections from module build
     sed -ri "/AC_CONFIG_FILES/,/]\)/{
 /AC_CONFIG_FILES/n

fryfrog commented on 2020-06-17 20:27

I'm using archzfs/zfs-dkms and it builds fine for 5.7.2. I would expect aur/zfs-dkms to be equally fine. Have you tried?

sphere101 commented on 2020-06-17 20:25

Does zfs-dkms 0.8.4-1 build on the latest kernel 5.7.2? Thanks, Anderson

sunflsks commented on 2020-06-02 16:20

Thanks. I managed to fix it by install zfs-dkms-git instead. Still getting a few weird errors, but at least it works now :)

itoffshore commented on 2020-06-02 16:01

@sunfisks - pacman -U $(ls /var/cache/pacman/pkg/gcc*-9.3.0-1*)

sunflsks commented on 2020-06-02 14:10

Question, how did you downgrade gcc?

itoffshore commented on 2020-06-02 11:43

To build correctly under linux-hardened I needed to downgrade gcc & gcc-libs to 9.3.0-1 - this also applied to nvidia-beta-dkms

I also upgraded to dkms 2.8.1-4 from testing

jjb2016 commented on 2020-05-24 07:51

You can just remove the zfs-dkms and zfs-utils packages, and then reinstall them ...

pacman -R zfs-dkms zfs-utils
And then ...
yay -S zfs-dkms
Reboot after that. zfs-utils will be automatically installed as a dependency. This has always worked for me when I've needed to do it. The only thing to note is that the /etc/zfs/zed.d/zed.rc file will be replaced with a new default file, so if you've made any changes in there for the zed service (for example for email notifications) then you will have to edit that file again, or restore it from a backup.

Marius_Elvenwood commented on 2020-05-24 01:01

@FrederickZh that seems to have worked, thanks! Ran install, restarted and ran zpool status to ensure the pool was still available.
The full command I used was # pacman -U ~/.cache/yay/zfs-dkms/zfs-dkms-0.8.4-1-any.pkg.tar.xz ~/.cache/yay/zfs-utils/zfs-utils-0.8.4-1-x86_64.pkg.tar.xz