forked from pool/openafs
cfa65eea8c
- update to openafs-1.8.11 - apply upstream patches for kernel 6.8 * 056a7a8.diff * 05ac614.diff * 073adec.diff * 0d9f6cf.diff * 0e983a9.diff * 112fb94.diff * 1e1bf8e.diff * 2056ce8.diff * 5312d06.diff * 67e48c8.diff * 6b20756.diff * 743d72f.diff * 7cae97b.diff * 81b910a.diff * 87ab04a.diff * 9f052c1.diff * a14a9ad.diff * a87845d.diff * aae8b00.diff * b77b304.diff * d1c89ac.diff * d9f3a2c.diff * db91384.diff * dffd0e1.diff * e0f425a.diff * e157f8f.diff * e428053.diff * ef7b8c5.diff * f5bafb0.diff * fca6fd9.diff OBS-URL: https://build.opensuse.org/request/show/1170220 OBS-URL: https://build.opensuse.org/package/show/filesystems/openafs?expand=0&rev=123
82 lines
2.8 KiB
Diff
82 lines
2.8 KiB
Diff
From 81b910ab4a0ef0d0b6cd3a1a636fcbcd050c0245 Mon Sep 17 00:00:00 2001
|
|
From: Cheyenne Wills <cwills@sinenomine.net>
|
|
Date: Tue, 05 Mar 2024 08:37:47 -0700
|
|
Subject: [PATCH] Linux 6.8: Remove ctl_table sentinels
|
|
|
|
The Linux 6.8 commit 'sysctl: Remove the now superfluous sentinel
|
|
elements from ctl_table array' (c8a65501d3) was a clean up commit
|
|
that removed the sentinel entry in the ctl_table array (e.g. the
|
|
"null" entry at the end of the table).
|
|
|
|
As of Linux 6.8, including the sentinel entry (.procname =) in the
|
|
ctl_table is unnecessary, but doesn't yet break anything. But it is
|
|
likely that including the sentinel will start to cause runtime errors in
|
|
future Linux versions very soon, so avoid the sentinel when we can, to
|
|
avoid possible problems in the future.
|
|
|
|
Define a new macro that can be used as the last entry of a ctl_table
|
|
that will either add a "null" entry, or nothing.
|
|
|
|
There is not a specific build test we can use within configure, so we
|
|
must explicitly test the Linux version to decide if we need to use a
|
|
sentinel or not when defining the macro. We are selecting 6.8 to match
|
|
the version where the Linux kernel is removing the sentinels from the in
|
|
kernel filesystems.
|
|
|
|
Note: See the Linux merge commits 'Merge tag 'sysctl-6.8-rc1' of
|
|
git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux' (a05aea98d4)
|
|
for more details behind the staged removal of the sentinels in the
|
|
ctl_table structures and the potential future change for removing the
|
|
actual check for the sentinel within the Linux kernel.
|
|
|
|
Reviewed-on: https://gerrit.openafs.org/15645
|
|
Tested-by: BuildBot <buildbot@rampaginggeek.com>
|
|
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
|
|
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
|
|
(cherry picked from commit 35c8c1bf0b1cb48178f676ba5bcf16ad59c5a33b)
|
|
|
|
Change-Id: I34cb7586003e10a6c7438d7205123d57af30585e
|
|
---
|
|
|
|
diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c
|
|
index a0a0398..c1116fc 100644
|
|
--- a/src/afs/LINUX/osi_sysctl.c
|
|
+++ b/src/afs/LINUX/osi_sysctl.c
|
|
@@ -54,6 +54,14 @@
|
|
# define AFS_SYSCTL_INT(num, perms, var) \
|
|
AFS_SYSCTL_INT2(num, perms, #var, var)
|
|
|
|
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0)
|
|
+/* end of list sentinel not needed */
|
|
+# define AFS_SYSCTL_SENTINEL
|
|
+# else
|
|
+/* NULL entry to mark the end of the list */
|
|
+# define AFS_SYSCTL_SENTINEL { .procname = NULL }
|
|
+# endif
|
|
+
|
|
static struct ctl_table_header *afs_sysctl = NULL;
|
|
|
|
static struct ctl_table afs_sysctl_table[] = {
|
|
@@ -75,9 +83,7 @@
|
|
AFS_SYSCTL_INT( 13, 0644, afs_cacheBlocks),
|
|
AFS_SYSCTL_INT2(14, 0644, "md5inum", afs_md5inum),
|
|
|
|
- {
|
|
- .procname = 0
|
|
- }
|
|
+ AFS_SYSCTL_SENTINEL
|
|
};
|
|
# if !defined(HAVE_LINUX_REGISTER_SYSCTL)
|
|
static struct ctl_table fs_sysctl_table[] = {
|
|
@@ -87,9 +93,7 @@
|
|
.mode = 0555,
|
|
.child = afs_sysctl_table
|
|
},
|
|
- {
|
|
- .procname = 0
|
|
- }
|
|
+ AFS_SYSCTL_SENTINEL
|
|
};
|
|
# endif
|
|
int
|