diff -Nru zfs-linux-0.8.3/debian/changelog zfs-linux-0.8.3/debian/changelog --- zfs-linux-0.8.3/debian/changelog 2020-07-22 10:58:22.000000000 +0200 +++ zfs-linux-0.8.3/debian/changelog 2020-08-18 11:10:41.000000000 +0200 @@ -1,3 +1,13 @@ +zfs-linux (0.8.3-1ubuntu12.4) focal; urgency=medium + + * Fix zfs-dkms build on arm64 with PREEMPTION and BLK_CGROUP (LP: #1892001) + - 4700-Fix-DKMS-build-on-arm64-with-PREEMPTION-and-BLK_CGRO.patch + preempt_schedule_notrace is GPL-only so redfine it to preempt_schedule + on arm64 with PREEMPTION and BLK_CGROUP enabled to 'fix' the DKMS + build failure. + + -- Juerg Haefliger Tue, 18 Aug 2020 11:10:41 +0200 + zfs-linux (0.8.3-1ubuntu12.3) focal; urgency=medium * Fix volume wait on locked encrypted zvols (LP: #1888405) diff -Nru zfs-linux-0.8.3/debian/patches/4700-Fix-DKMS-build-on-arm64-with-PREEMPTION-and-BLK_CGRO.patch zfs-linux-0.8.3/debian/patches/4700-Fix-DKMS-build-on-arm64-with-PREEMPTION-and-BLK_CGRO.patch --- zfs-linux-0.8.3/debian/patches/4700-Fix-DKMS-build-on-arm64-with-PREEMPTION-and-BLK_CGRO.patch 1970-01-01 01:00:00.000000000 +0100 +++ zfs-linux-0.8.3/debian/patches/4700-Fix-DKMS-build-on-arm64-with-PREEMPTION-and-BLK_CGRO.patch 2020-08-18 11:10:41.000000000 +0200 @@ -0,0 +1,56 @@ +From 46cd180400093965271820d34fa1071f9769a0fb Mon Sep 17 00:00:00 2001 +From: Juerg Haefliger +Date: Tue, 18 Aug 2020 10:52:25 +0200 +Subject: [PATCH] Fix DKMS build on arm64 with PREEMPTION and BLK_CGROUP + enabled + +With PREEMPTION=y and BLK_CGROUP=y preempt_schedule_notrace() is being +used on arm64 which is a GPL-only function and hence the build of the +DKMS kernel module fails. + +'Fix' that by redefining preempt_schedule_notrace() to preempt_schedule() +which should be safe as long as tracing is not used. + +Signed-off-by: Juerg Haefliger +--- + module/zfs/vdev_disk.c | 2 ++ + module/zfs/zfs_compat.h | 14 ++++++++++++++ + 2 files changed, 16 insertions(+) + create mode 100644 module/zfs/zfs_compat.h + +diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c +index 8544bb8ffb6f..2a7096a6436d 100644 +--- a/module/zfs/vdev_disk.c ++++ b/module/zfs/vdev_disk.c +@@ -26,6 +26,8 @@ + * Copyright (c) 2012, 2019 by Delphix. All rights reserved. + */ + ++#include "zfs_compat.h" ++ + #include + #include + #include +diff --git a/module/zfs/zfs_compat.h b/module/zfs/zfs_compat.h +new file mode 100644 +index 000000000000..6ef26f436f3c +--- /dev/null ++++ b/module/zfs/zfs_compat.h +@@ -0,0 +1,14 @@ ++#ifndef _ZFS_COMPAT_H_ ++#define _ZFS_COMPAT_H_ ++ ++/* ++ * preempt_schedule_notrace is GPL-only which breaks the ZFS build, so ++ * replace it with preempt_schedule under the following condition: ++*/ ++#if defined(CONFIG_ARM64) && \ ++ defined(CONFIG_PREEMPTION) && \ ++ defined(CONFIG_BLK_CGROUP) ++#define preempt_schedule_notrace(x) preempt_schedule(x) ++#endif ++ ++#endif /* _ZFS_COMPAT_H_ */ +-- +2.25.1 + diff -Nru zfs-linux-0.8.3/debian/patches/series zfs-linux-0.8.3/debian/patches/series --- zfs-linux-0.8.3/debian/patches/series 2020-07-22 10:49:52.000000000 +0200 +++ zfs-linux-0.8.3/debian/patches/series 2020-08-18 11:10:41.000000000 +0200 @@ -21,3 +21,4 @@ zfs-mount-container-start.patch 4610-ICP-Improve-AES-GCM-performance.patch 4620-zfs-vol-wait-fix-locked-encrypted-vols.patch +4700-Fix-DKMS-build-on-arm64-with-PREEMPTION-and-BLK_CGRO.patch