SHA256
1
0
forked from pool/openafs
openafs/5b647bf.diff
Christof Hanke 074981dc71 Accepting request 1126478 from home:hauky:branches:filesystems
- apply upstream-patches for kernel 6.6: 
  * 5b647bf.diff
  * 6413fdb.diff
  * 4f1d810.diff
- replace upstream-patch for kernel 6.5 474750a.diff by correct commit 
  6de0a64.diffa for branch openafs-stable-1_8_x

OBS-URL: https://build.opensuse.org/request/show/1126478
OBS-URL: https://build.opensuse.org/package/show/filesystems/openafs?expand=0&rev=113
2023-11-15 05:33:04 +00:00

56 lines
2.4 KiB
Diff

From 5b647bf17a878271e1ce9882e41663770ee73528 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Wed, 06 Sep 2023 11:41:55 -0600
Subject: [PATCH] LINUX: Pass an array of structs to register_sysctl
The Linux 6.6 commit "sysctl: Add size to register_sysctl" (9edbfe92a0)
renamed the Linux function register_sysctl() to register_sysctl_sz() and
added a size parameter. For backward compatibility, a macro,
register_sysctl, is provided. The macro calculates the size of the
ctl_table being registered and passes the size to register_sysctl_sz.
However, in order to perform the size calculation, an array of ctl_table
structures must be passed as the 2nd parameter.
This change only affects the autoconf test used to determine if Linux
provides register_sysctl.
Update the autoconf test for register_sysctl to use an actual ctl_table
structure for the 2nd parameter instead of a NULL.
Reviewed-on: https://gerrit.openafs.org/15559
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 76879b28798840fa0df441c328ada9667f06b154)
Change-Id: I9209d9fbc4514ab658f373510decfc2e81a5dc5f
Reviewed-on: https://gerrit.openafs.org/15575
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
---
diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
index 8119549..b913676 100644
--- a/src/cf/linux-kernel-func.m4
+++ b/src/cf/linux-kernel-func.m4
@@ -220,10 +220,13 @@
dnl Linux 6.5 removed the Linux function register_sysctl_table(), which
dnl was deprecated in Linux 6.3 in favor of register_sysctl() which was
dnl introduced in Linux 3.3
+dnl Linux 6.6 changed the function register_sysctl to a macro that requires
+dnl an array of ctl_table structures as its 2nd parameter
AC_CHECK_LINUX_FUNC([register_sysctl],
- [#include <linux/kernel.h>
- #include <linux/sysctl.h>],
- [(void)register_sysctl(NULL, NULL);])
+ [#include <linux/kernel.h>
+ #include <linux/sysctl.h>],
+ [[static struct ctl_table cf_sysctl_table[1];
+ (void)register_sysctl(NULL, cf_sysctl_table);]])
dnl Consequences - things which get set as a result of the
dnl above tests