summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Laß2023-09-01 21:04:07 +0200
committerMichael Laß2023-09-01 21:04:07 +0200
commit182504e8697f86112819eb94f6309d43f7975875 (patch)
treeb61f4d5af69648b250327d891545340ea39cb37e
parent4b2fa422803735e68c6c8cada472a999912b0769 (diff)
downloadaur-182504e8697f86112819eb94f6309d43f7975875.tar.gz
Add another patch for Linux 6.5
See https://gerrit.openafs.org/15558/
-rw-r--r--.SRCINFO12
-rw-r--r--0001-Linux-6.5-Replace-generic_file_splice_read.patch2
-rw-r--r--0002-LINUX-Make-sysctl-definitions-more-concise.patch2
-rw-r--r--0003-Linux-6.5-Use-register_sysctl.patch2
-rw-r--r--0004-hcrypto-rename-abort-to-_afscrypto_abort.patch2
-rw-r--r--0005-linux-Replace-fop-iterate-with-fop-iterate_shared.patch120
-rw-r--r--PKGBUILD15
7 files changed, 140 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0affbf6993db..8df324bba6e4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = openafs-modules-dkms
pkgdesc = Kernel module for OpenAFS (dkms)
pkgver = 1.8.10
- pkgrel = 2
+ pkgrel = 3
url = http://www.openafs.org
arch = i686
arch = x86_64
@@ -21,11 +21,13 @@ pkgbase = openafs-modules-dkms
source = 0002-LINUX-Make-sysctl-definitions-more-concise.patch
source = 0003-Linux-6.5-Use-register_sysctl.patch
source = 0004-hcrypto-rename-abort-to-_afscrypto_abort.patch
+ source = 0005-linux-Replace-fop-iterate-with-fop-iterate_shared.patch
sha256sums = 9fec11364623549e8db7374072f5c8f01b841f6bfe7e85673cbce35ff43ffb07
sha256sums = 5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0
- sha256sums = 0d926266a44d210d27564773731086af5da37ea9f541a94077aa82afd0181584
- sha256sums = 132aaa4a55d22756b77c77326b0858215217f9c45e207c891b2b3207d107489c
- sha256sums = 349c6335343cad6b2b5dbce85fabb7679522a89e035cdadaa7545de5e7f5dcde
- sha256sums = 60c788f28afa589ae7535154efc8c1c7d9a28852e5bb3433878377fee3e522a1
+ sha256sums = 81f3cf88040eee89ed180d683ba1a42107ea4a6c7057fd3dac679be9a9a9ab01
+ sha256sums = 873c2b3816eed95e1799954d299e4411aa8079f267077dc1a3a3c564d3e2524c
+ sha256sums = da4b625e6885ae9bccc7428b1556751ea134510540e59fa4e8170cfba4d454dc
+ sha256sums = 42d2363ac0bcd5e87afc60ac656bb1ead8ab885d0deca6b0f8318b9bbf191b67
+ sha256sums = 05a52fcc975b940cf15ba78ec2f76c00580f2db939bea32bcd99ef4c1dfdad1b
pkgname = openafs-modules-dkms
diff --git a/0001-Linux-6.5-Replace-generic_file_splice_read.patch b/0001-Linux-6.5-Replace-generic_file_splice_read.patch
index 07a96be3e9ef..2e71324ff79c 100644
--- a/0001-Linux-6.5-Replace-generic_file_splice_read.patch
+++ b/0001-Linux-6.5-Replace-generic_file_splice_read.patch
@@ -1,7 +1,7 @@
From 04083bc9a31156e34782b689993737f7c9def427 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Sun, 9 Jul 2023 18:52:23 -0600
-Subject: [PATCH 1/4] Linux 6.5: Replace generic_file_splice_read
+Subject: [PATCH 1/5] Linux 6.5: Replace generic_file_splice_read
The Linux 6.5 commit:
'splice: Remove generic_file_splice_read()' (c6585011bc)
diff --git a/0002-LINUX-Make-sysctl-definitions-more-concise.patch b/0002-LINUX-Make-sysctl-definitions-more-concise.patch
index 78dd66d422c7..9fbe6a757b80 100644
--- a/0002-LINUX-Make-sysctl-definitions-more-concise.patch
+++ b/0002-LINUX-Make-sysctl-definitions-more-concise.patch
@@ -1,7 +1,7 @@
From 48e0bd7d929fac0cd415c7e8f7886782dcd324ef Mon Sep 17 00:00:00 2001
From: Andrew Deason <adeason@sinenomine.net>
Date: Thu, 18 Jul 2019 22:56:48 -0500
-Subject: [PATCH 2/4] LINUX: Make sysctl definitions more concise
+Subject: [PATCH 2/5] LINUX: Make sysctl definitions more concise
Our sysctl definitions are quite verbose, and adding new ones involves
copying a bunch of lines. Make these a little easier to specify, by
diff --git a/0003-Linux-6.5-Use-register_sysctl.patch b/0003-Linux-6.5-Use-register_sysctl.patch
index 8f51893015a0..aa718cf774c6 100644
--- a/0003-Linux-6.5-Use-register_sysctl.patch
+++ b/0003-Linux-6.5-Use-register_sysctl.patch
@@ -1,7 +1,7 @@
From aef0016df74fcd3da0f6cb6622d73cd9ceb77358 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Thu, 13 Jul 2023 10:54:22 -0600
-Subject: [PATCH 3/4] Linux 6.5: Use register_sysctl()
+Subject: [PATCH 3/5] Linux 6.5: Use register_sysctl()
The linux 6.5 commit:
"sysctl: Remove register_sysctl_table" (b8cbc0855a)
diff --git a/0004-hcrypto-rename-abort-to-_afscrypto_abort.patch b/0004-hcrypto-rename-abort-to-_afscrypto_abort.patch
index 692702d9232e..c7f9c109b887 100644
--- a/0004-hcrypto-rename-abort-to-_afscrypto_abort.patch
+++ b/0004-hcrypto-rename-abort-to-_afscrypto_abort.patch
@@ -1,7 +1,7 @@
From 01d7316f6773591186f606de5e3b12de28bb0cd9 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Sun, 9 Jul 2023 18:45:15 -0600
-Subject: [PATCH 4/4] hcrypto: rename abort to _afscrypto_abort
+Subject: [PATCH 4/5] hcrypto: rename abort to _afscrypto_abort
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
diff --git a/0005-linux-Replace-fop-iterate-with-fop-iterate_shared.patch b/0005-linux-Replace-fop-iterate-with-fop-iterate_shared.patch
new file mode 100644
index 000000000000..97b367583db3
--- /dev/null
+++ b/0005-linux-Replace-fop-iterate-with-fop-iterate_shared.patch
@@ -0,0 +1,120 @@
+From fea2bd506b40543d6d9ec862acafb6622fb97ff8 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Tue, 29 Aug 2023 14:58:10 -0600
+Subject: [PATCH 5/5] linux: Replace fop iterate with fop iterate_shared
+
+The Linux 6.5 commit:
+ 'vfs: get rid of old '->iterate' directory operation' (3e32715496)
+removed the filesystem_operations iterate method. The replacement
+method, iterate_shared, was introduced with the Linux 4.6 commit:
+ 'introduce a parallel variant of ->iterate()' (6192269444)
+
+The above commits indicate that the iterate_shared is an "almost"
+drop-in replacement for iterate. The vfs documentation for
+iterate_shared has caveats on the implementation (serializing in-core
+per-inode or per-dentry modifications and using d_alloc_parallel if
+doing dcache pre-seeding). A wrapper is provided to assist filesystems
+with the migration from iterate to iterate_shared. Until it can be
+verified that afs_linux_readdir meets the above requirements, we will
+use the wrapper (ref 3e32715496 commit)
+
+Add configure tests for the iterate_shared file_operations member and
+for the wrap_directory_iterator function.
+
+Update osi_vnodeops.c to use iterate_shared and the wrapper if they are
+both available.
+
+Reviewed-on: https://gerrit.openafs.org/15528
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+(cherry picked from commit 7437f4d37719ea53711e06ac9675dad1abd6769e)
+
+Change-Id: Id00cfab2c0b51c2167fe19cd9cf7f136450ff174
+---
+ src/afs/LINUX/osi_vnodeops.c | 19 +++++++++++++++----
+ src/cf/linux-kernel-func.m4 | 10 ++++++++++
+ src/cf/linux-kernel-struct.m4 | 1 +
+ 3 files changed, 26 insertions(+), 4 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index dd8b39d5d..fb62752e6 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -54,14 +54,16 @@
+ # define D_SPLICE_ALIAS_RACE
+ #endif
+
++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE_SHARED) && defined(HAVE_LINUX_WRAP_DIRECTORY_ITERATOR)
++# define USE_FOP_ITERATE 1
++#elif defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) && !defined(FMODE_KABI_ITERATE)
+ /* Workaround for RH 7.5 which introduced file operation iterate() but requires
+ * each file->f_mode to be marked with FMODE_KABI_ITERATE. Instead OpenAFS will
+ * continue to use file opearation readdir() in this case.
+ */
+-#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) && !defined(FMODE_KABI_ITERATE)
+-#define USE_FOP_ITERATE 1
++# define USE_FOP_ITERATE 1
+ #else
+-#undef USE_FOP_ITERATE
++# undef USE_FOP_ITERATE
+ #endif
+
+ /* Kernels from before 2.6.19 may not be able to return errors from
+@@ -909,10 +911,19 @@ out:
+ crfree(credp);
+ return afs_convert_code(code);
+ }
++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE_SHARED) && defined(HAVE_LINUX_WRAP_DIRECTORY_ITERATOR)
++# if defined(WRAP_DIR_ITER)
++WRAP_DIR_ITER(afs_linux_readdir) /* Adds necessary locking for iterate_shared */
++# else
++# error the Linux provided macro WRAP_DIR_ITER is not available
++# endif
++#endif
+
+ struct file_operations afs_dir_fops = {
+ .read = generic_read_dir,
+-#if defined(USE_FOP_ITERATE)
++#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE_SHARED) && defined(HAVE_LINUX_WRAP_DIRECTORY_ITERATOR)
++ .iterate_shared = shared_afs_linux_readdir,
++#elif defined(USE_FOP_ITERATE)
+ .iterate = afs_linux_readdir,
+ #else
+ .readdir = afs_linux_readdir,
+diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
+index 811954915..145725575 100644
+--- a/src/cf/linux-kernel-func.m4
++++ b/src/cf/linux-kernel-func.m4
+@@ -225,6 +225,16 @@ AC_CHECK_LINUX_FUNC([register_sysctl],
+ #include <linux/sysctl.h>],
+ [(void)register_sysctl(NULL, NULL);])
+
++dnl Linux 6.5 removed the file_operations method 'iterate'. Filesystems should
++dnl using the iterate_shared method (introduced in linux 4.6). Linux 6.4
++dnl provides a wrapper that can be used for filesystems that haven't fully
++dnl converted to meet the iterate_shared requirements.
++
++AC_CHECK_LINUX_FUNC([wrap_directory_iterator],
++ [#include <linux/kernel.h>
++ #include <linux/fs.h>],
++ [(void)wrap_directory_iterator(NULL, NULL, NULL);])
++
+ dnl Consequences - things which get set as a result of the
+ dnl above tests
+ AS_IF([test "x$ac_cv_linux_func_d_alloc_anon" = "xno"],
+diff --git a/src/cf/linux-kernel-struct.m4 b/src/cf/linux-kernel-struct.m4
+index 8082308e8..52e10acb8 100644
+--- a/src/cf/linux-kernel-struct.m4
++++ b/src/cf/linux-kernel-struct.m4
+@@ -23,6 +23,7 @@ AC_CHECK_LINUX_STRUCT([inode], [i_mutex], [fs.h])
+ AC_CHECK_LINUX_STRUCT([inode], [i_security], [fs.h])
+ AC_CHECK_LINUX_STRUCT([file], [f_path], [fs.h])
+ AC_CHECK_LINUX_STRUCT([file_operations], [flock], [fs.h])
++AC_CHECK_LINUX_STRUCT([file_operations], [iterate_shared], [fs.h])
+ AC_CHECK_LINUX_STRUCT([file_operations], [iterate], [fs.h])
+ AC_CHECK_LINUX_STRUCT([file_operations], [read_iter], [fs.h])
+ AC_CHECK_LINUX_STRUCT([file_operations], [sendfile], [fs.h])
+--
+2.42.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 99ea1f4c909d..b5483b6b779b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,7 +7,7 @@
pkgname=openafs-modules-dkms
_srcname=openafs
pkgver=1.8.10
-pkgrel=2
+pkgrel=3
pkgdesc="Kernel module for OpenAFS (dkms)"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.openafs.org"
@@ -21,13 +21,15 @@ source=(http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz
0001-Linux-6.5-Replace-generic_file_splice_read.patch
0002-LINUX-Make-sysctl-definitions-more-concise.patch
0003-Linux-6.5-Use-register_sysctl.patch
- 0004-hcrypto-rename-abort-to-_afscrypto_abort.patch)
+ 0004-hcrypto-rename-abort-to-_afscrypto_abort.patch
+ 0005-linux-Replace-fop-iterate-with-fop-iterate_shared.patch)
sha256sums=('9fec11364623549e8db7374072f5c8f01b841f6bfe7e85673cbce35ff43ffb07'
'5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0'
- '0d926266a44d210d27564773731086af5da37ea9f541a94077aa82afd0181584'
- '132aaa4a55d22756b77c77326b0858215217f9c45e207c891b2b3207d107489c'
- '349c6335343cad6b2b5dbce85fabb7679522a89e035cdadaa7545de5e7f5dcde'
- '60c788f28afa589ae7535154efc8c1c7d9a28852e5bb3433878377fee3e522a1')
+ '81f3cf88040eee89ed180d683ba1a42107ea4a6c7057fd3dac679be9a9a9ab01'
+ '873c2b3816eed95e1799954d299e4411aa8079f267077dc1a3a3c564d3e2524c'
+ 'da4b625e6885ae9bccc7428b1556751ea134510540e59fa4e8170cfba4d454dc'
+ '42d2363ac0bcd5e87afc60ac656bb1ead8ab885d0deca6b0f8318b9bbf191b67'
+ '05a52fcc975b940cf15ba78ec2f76c00580f2db939bea32bcd99ef4c1dfdad1b')
prepare() {
cd "${srcdir}/${_srcname}-${pkgver}"
@@ -37,6 +39,7 @@ prepare() {
patch -p1 < "${srcdir}"/0002-LINUX-Make-sysctl-definitions-more-concise.patch
patch -p1 < "${srcdir}"/0003-Linux-6.5-Use-register_sysctl.patch
patch -p1 < "${srcdir}"/0004-hcrypto-rename-abort-to-_afscrypto_abort.patch
+ patch -p1 < "${srcdir}"/0005-linux-Replace-fop-iterate-with-fop-iterate_shared.patch
# Only needed when changes to configure were made
./regen.sh -q