]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Linux 4.11 compat: remove stub for __put_task_struct
authorOlaf Faaland <faaland1@llnl.gov>
Mon, 13 Mar 2017 17:37:10 +0000 (10:37 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 21 Mar 2017 00:43:45 +0000 (17:43 -0700)
Before kernel 2.6.29 credentials were embedded in task_structs, and zfs had
cases where one thread would need to refer to the credential of another thread,
forcing it to take a hold on the foreign thread's task_struct to ensure it was
not freed.

Since 2.6.29, the credential has been moved out of the task_struct into a
cred_t.

In addition, the mainline kernel originally did not export __put_task_struct()
but the RHEL5 kernel did, according to zfsonlinux/spl@e811949a570.  As of
2.6.39 the mainline kernel exports it.

There is no longer zfs code that takes or releases holds on a task_struct, and
so there is no longer any reference to __put_task_struct().

This affects the linux 4.11 kernel because the prototype for
__put_task_struct() is in a new include file (linux/sched/task.h) and so the
config check failed to detect the exported symbol.

Removing the unnecessary stub and corresponding config check.  This works on
kernels since the oldest one currently supported, 2.6.32 as shipped with
Centos/RHEL.

Reviewed-by: Chunwei Chen <david.chen@osnexus.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #608

config/spl-build.m4
module/spl/spl-generic.c

index 1dbc87e615163818c4109e9edbe390f87ff6b3fd..b5aa7adac54fbebdca04f0f1128ff84660a1e8c0 100644 (file)
@@ -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
@@ -1085,25 +1084,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 <linux/sched.h>
-       ], [
-               __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.
index ce60963bd598b5e341bb313e5a0f77891f3b9d93..a9445eb37a9cdbe033584c87ed059643bef6ec4c 100644 (file)
@@ -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.
  *