From a5fdba1185eeb1b6596e656a3e6bf3ef39b87ea3 Mon Sep 17 00:00:00 2001 From: Brian Atkinson Date: Tue, 1 Aug 2023 17:48:19 -0400 Subject: [PATCH] Revert "Linux 6.5 compat: register_sysctl_table removed" This reverts commit b35374fd6474603170fd9a3c7503da6eb13ac712 as there are error messages when loading the SPL module. Errors seemed to be tied to duplicate a duplicate entry. Reviewed-by: Brian Behlendorf Signed-off-by: Brian Atkinson Closes #15134 --- config/kernel-register_sysctl_table.m4 | 27 -------------------------- config/kernel.m4 | 2 -- module/os/linux/spl/spl-proc.c | 26 +++---------------------- 3 files changed, 3 insertions(+), 52 deletions(-) delete mode 100644 config/kernel-register_sysctl_table.m4 diff --git a/config/kernel-register_sysctl_table.m4 b/config/kernel-register_sysctl_table.m4 deleted file mode 100644 index f18316b32b6d..000000000000 --- a/config/kernel-register_sysctl_table.m4 +++ /dev/null @@ -1,27 +0,0 @@ -dnl # -dnl # Linux 6.5 removes register_sysctl_table -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE], [ - ZFS_LINUX_TEST_SRC([has_register_sysctl_table], [ - #include - - static struct ctl_table dummy_table[] = { - {} - }; - - ],[ - struct ctl_table_header *h - __attribute((unused)) = register_sysctl_table(dummy_table); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE], [ - AC_MSG_CHECKING([whether register_sysctl_table exists]) - ZFS_LINUX_TEST_RESULT([has_register_sysctl_table], [ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_SYSCTL_REGISTER_TABLE, 1, - [sysctl_register_table exists]) - ],[ - AC_MSG_RESULT([no]) - ]) -]) diff --git a/config/kernel.m4 b/config/kernel.m4 index 28bd361d33ff..1487fa2e7793 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -160,7 +160,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ ZFS_AC_KERNEL_SRC_FILEMAP ZFS_AC_KERNEL_SRC_WRITEPAGE_T ZFS_AC_KERNEL_SRC_RECLAIMED - ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE case "$host_cpu" in powerpc*) ZFS_AC_KERNEL_SRC_CPU_HAS_FEATURE @@ -300,7 +299,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ ZFS_AC_KERNEL_FILEMAP ZFS_AC_KERNEL_WRITEPAGE_T ZFS_AC_KERNEL_RECLAIMED - ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE case "$host_cpu" in powerpc*) ZFS_AC_KERNEL_CPU_HAS_FEATURE diff --git a/module/os/linux/spl/spl-proc.c b/module/os/linux/spl/spl-proc.c index bcc356ae55b6..01f5619e1893 100644 --- a/module/os/linux/spl/spl-proc.c +++ b/module/os/linux/spl/spl-proc.c @@ -624,7 +624,6 @@ static struct ctl_table spl_table[] = { .mode = 0644, .proc_handler = &proc_dohostid, }, -#ifdef HAVE_REGISTER_SYSCTL_TABLE { .procname = "kmem", .mode = 0555, @@ -635,11 +634,9 @@ static struct ctl_table spl_table[] = { .mode = 0555, .child = spl_kstat_table, }, -#endif {}, }; -#ifdef HAVE_REGISTER_SYSCTL_TABLE static struct ctl_table spl_dir[] = { { .procname = "spl", @@ -651,38 +648,21 @@ static struct ctl_table spl_dir[] = { static struct ctl_table spl_root[] = { { - .procname = "kernel", - .mode = 0555, - .child = spl_dir, + .procname = "kernel", + .mode = 0555, + .child = spl_dir, }, {} }; -#endif int spl_proc_init(void) { int rc = 0; -#ifdef HAVE_REGISTER_SYSCTL_TABLE spl_header = register_sysctl_table(spl_root); if (spl_header == NULL) return (-EUNATCH); -#else - spl_header = register_sysctl("kernel/spl", spl_table); - if (spl_header == NULL) - return (-EUNATCH); - - if (register_sysctl("kernel/spl/kmem", spl_kmem_table) == NULL) { - rc = -EUNATCH; - goto out; - } - - if (register_sysctl("kernel/spl/kstat", spl_kstat_table) == NULL) { - rc = -EUNATCH; - goto out; - } -#endif proc_spl = proc_mkdir("spl", NULL); if (proc_spl == NULL) {