Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoconf: Fail when __copy_from_user_inatomic is a non-GPL symbol #13389

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions config/kernel-copy-from-user-inatomic.m4
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ AC_DEFUN([ZFS_AC_KERNEL___COPY_FROM_USER_INATOMIC], [
AC_MSG_CHECKING([whether __copy_from_user_inatomic is available])
ZFS_LINUX_TEST_RESULT([__copy_from_user_inatomic_license], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE___COPY_FROM_USER_INATOMIC, 1,
[__copy_from_user_inatomic is available])
], [
AC_MSG_RESULT(no)
AC_MSG_ERROR([
*** The `__copy_from_user_inatomic()` Linux kernel function license
*** (GPL only) is incompatible with the OpenZFS license
*** ($ZFS_META_LICENSE). OpenZFS cannot be compiled due to
*** legal and compliance reasons.
])
])
])
4 changes: 0 additions & 4 deletions module/os/linux/zfs/zfs_uio.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ zfs_uiomove_iov(void *p, size_t n, zfs_uio_rw_t rw, zfs_uio_t *uio)
} else {
unsigned long b_left = 0;
if (uio->uio_fault_disable) {
#if defined(HAVE___COPY_FROM_USER_INATOMIC)
if (!zfs_access_ok(VERIFY_READ,
(iov->iov_base + skip), cnt)) {
return (EFAULT);
Expand All @@ -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,
(iov->iov_base + skip), cnt);
pagefault_enable();
#else
return (EFAULT);
#endif
szubersk marked this conversation as resolved.
Show resolved Hide resolved
} else {
b_left =
copy_from_user(p,
Expand Down