From 2e407941a2148ab400d8b4e3748cc894e411c0c4 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 25 Sep 2020 13:28:35 -0700 Subject: 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 Signed-off-by: Juerg Haefliger Closes #8545 Closes #9948 Closes #10416 Closes #10973 --- module/os/linux/zfs/vdev_disk.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) /* -- cgit v1.2.3