From eff53aba97592b7d4dece6a8755cffb24047f3cf Mon Sep 17 00:00:00 2001 From: Olaf Faaland Date: Mon, 13 Mar 2017 10:37:10 -0700 Subject: [PATCH] Linux 4.11 compat: remove stub for __put_task_struct In some kernel older than 2.6.35, something in spl or zfs needed to link against __put_task_struct() even though it should never be called by zfs. Which kernel that was, and what code needed to link against __put_task_struct(), is unknown to me. This is no longer the case. spl/zfs build and the modules install successfully on a RHEL6 derivative with kernel 2.6.32-642.13.1.1chaos.ch5.5.x86_64 without the stub, as well as 4.8.0-22-generic under Ubuntu and 4.11 kernel built from github/torvalds/linux. This came up with the linux 4.11 kernel because the prototype for __put_task_struct() is in a new include file and so the config check failed to detect the exported symbol. Removing the unnecessary stub and corresponding config check. Signed-off-by: Olaf Faaland --- config/spl-build.m4 | 20 -------------------- module/spl/spl-generic.c | 16 ---------------- 2 files changed, 36 deletions(-) diff --git a/config/spl-build.m4 b/config/spl-build.m4 index ffc9b6b7..0e235905 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -33,7 +33,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ SPL_AC_INODE_TRUNCATE_RANGE SPL_AC_FS_STRUCT_SPINLOCK SPL_AC_KUIDGID_T - SPL_AC_PUT_TASK_STRUCT SPL_AC_KERNEL_FALLOCATE SPL_AC_CONFIG_ZLIB_INFLATE SPL_AC_CONFIG_ZLIB_DEFLATE @@ -1083,25 +1082,6 @@ AC_DEFUN([SPL_AC_KUIDGID_T], [ ]) ]) -dnl # -dnl # 2.6.39 API change, -dnl # __put_task_struct() was exported by the mainline kernel. -dnl # -AC_DEFUN([SPL_AC_PUT_TASK_STRUCT], - [AC_MSG_CHECKING([whether __put_task_struct() is available]) - SPL_LINUX_TRY_COMPILE_SYMBOL([ - #include - ], [ - __put_task_struct(NULL); - ], [__put_task_struct], [], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_PUT_TASK_STRUCT, 1, - [__put_task_struct() is available]) - ], [ - AC_MSG_RESULT(no) - ]) -]) - dnl # dnl # 2.6.35 API change, dnl # Unused 'struct dentry *' removed from vfs_fsync() prototype. diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index ce60963b..a9445eb3 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -459,22 +459,6 @@ ddi_copyout(const void *from, void *to, size_t len, int flags) } EXPORT_SYMBOL(ddi_copyout); -#ifndef HAVE_PUT_TASK_STRUCT -/* - * This is only a stub function which should never be used. The SPL should - * never be putting away the last reference on a task structure so this will - * not be called. However, we still need to define it so the module does not - * have undefined symbol at load time. That all said if this impossible - * thing does somehow happen PANIC immediately so we know about it. - */ -void -__put_task_struct(struct task_struct *t) -{ - PANIC("Unexpectly put last reference on task %d\n", (int)t->pid); -} -EXPORT_SYMBOL(__put_task_struct); -#endif /* HAVE_PUT_TASK_STRUCT */ - /* * Read the unique system identifier from the /etc/hostid file. *