aboutsummaryrefslogtreecommitdiffstats
path: root/module/os/linux/zfs/vdev_disk.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2020-09-25 13:28:35 -0700
committerGitHub <[email protected]>2020-09-25 13:28:35 -0700
commit2e407941a2148ab400d8b4e3748cc894e411c0c4 (patch)
treea37329023f282f53d38c7dbe3870bd390fa53b46 /module/os/linux/zfs/vdev_disk.c
parentf6bb7c029cabba405ff7072bfefa1dee55ccf0b4 (diff)
Fix PREEMPTION=y and BLK_CGROUP=y config on arm64
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. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Juerg Haefliger <[email protected]> Closes #8545 Closes #9948 Closes #10416 Closes #10973
Diffstat (limited to 'module/os/linux/zfs/vdev_disk.c')
-rw-r--r--module/os/linux/zfs/vdev_disk.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/module/os/linux/zfs/vdev_disk.c b/module/os/linux/zfs/vdev_disk.c
index 85daef43b..a54961c76 100644
--- a/module/os/linux/zfs/vdev_disk.c
+++ b/module/os/linux/zfs/vdev_disk.c
@@ -436,6 +436,16 @@ vdev_submit_bio_impl(struct bio *bio)
#endif
}
+/*
+ * 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
+
#ifdef HAVE_BIO_SET_DEV
#if defined(CONFIG_BLK_CGROUP) && defined(HAVE_BIO_SET_DEV_GPL_ONLY)
/*