Skip to content

Commit

Permalink
Fix PREEMPTION=y and BLK_CGROUP=y config on arm64
Browse files Browse the repository at this point in the history
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 openzfs#8545 
Closes openzfs#9948 
Closes openzfs#10416 
Closes openzfs#10973
  • Loading branch information
behlendorf authored and RageLtMan committed May 31, 2021
1 parent e0e732a commit e6ece63
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions module/os/linux/zfs/vdev_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
/*
Expand Down

0 comments on commit e6ece63

Please sign in to comment.