autoconf: Fail when __copy_from_user_inatomic is a non-GPL symbol

A followup to 849c14e048
Fix https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009242

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: szubersk <szuberskidamian@gmail.com>
Closes #13389
This commit is contained in:
szubersk 2022-05-07 00:53:42 +00:00 committed by Brian Behlendorf
parent 13b1f336d3
commit 756c3e085b
2 changed files with 5 additions and 6 deletions

View File

@ -18,9 +18,12 @@ AC_DEFUN([ZFS_AC_KERNEL___COPY_FROM_USER_INATOMIC], [
AC_MSG_CHECKING([whether __copy_from_user_inatomic is available]) AC_MSG_CHECKING([whether __copy_from_user_inatomic is available])
ZFS_LINUX_TEST_RESULT([__copy_from_user_inatomic_license], [ ZFS_LINUX_TEST_RESULT([__copy_from_user_inatomic_license], [
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
AC_DEFINE(HAVE___COPY_FROM_USER_INATOMIC, 1,
[__copy_from_user_inatomic is available])
], [ ], [
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
AC_MSG_ERROR([
*** The `__copy_from_user_inatomic()` Linux kernel function is
*** incompatible with the CDDL license and will prevent the module
*** linking stage from succeeding. OpenZFS cannot be compiled.
])
]) ])
]) ])

View File

@ -75,7 +75,6 @@ zfs_uiomove_iov(void *p, size_t n, zfs_uio_rw_t rw, zfs_uio_t *uio)
} else { } else {
unsigned long b_left = 0; unsigned long b_left = 0;
if (uio->uio_fault_disable) { if (uio->uio_fault_disable) {
#if defined(HAVE___COPY_FROM_USER_INATOMIC)
if (!zfs_access_ok(VERIFY_READ, if (!zfs_access_ok(VERIFY_READ,
(iov->iov_base + skip), cnt)) { (iov->iov_base + skip), cnt)) {
return (EFAULT); return (EFAULT);
@ -85,9 +84,6 @@ zfs_uiomove_iov(void *p, size_t n, zfs_uio_rw_t rw, zfs_uio_t *uio)
__copy_from_user_inatomic(p, __copy_from_user_inatomic(p,
(iov->iov_base + skip), cnt); (iov->iov_base + skip), cnt);
pagefault_enable(); pagefault_enable();
#else
return (EFAULT);
#endif
} else { } else {
b_left = b_left =
copy_from_user(p, copy_from_user(p,