From 972dfbd405ed8f46690a99b0736e579b40439575 Mon Sep 17 00:00:00 2001
From: hauky <>
Date: Nov 15 2023 20:36:35 +0000
Subject: Update openafs to version 1.8.10.1 / rev 44 via SR 1126553


https://build.opensuse.org/request/show/1126553
by user hauky + anag+factory

---

diff --git a/.files b/.files
index f81b2dc..776bde0 100644
Binary files a/.files and b/.files differ
diff --git a/.rev b/.rev
index befa9c9..cae0dca 100644
--- a/.rev
+++ b/.rev
@@ -574,4 +574,12 @@
     <comment></comment>
     <requestid>1114721</requestid>
   </revision>
+  <revision rev="44" vrev="2">
+    <srcmd5>9fe7ec8010ee870ae1a83da7ac90d83b</srcmd5>
+    <version>1.8.10.1</version>
+    <time>1700078936</time>
+    <user>anag+factory</user>
+    <comment></comment>
+    <requestid>1126553</requestid>
+  </revision>
 </revisionlist>
diff --git a/474750a.diff b/474750a.diff
deleted file mode 100644
index a84ed31..0000000
--- a/474750a.diff
+++ /dev/null
@@ -1,113 +0,0 @@
-From 474750a2008b2de37a05d6e51b31447d3a721dd4 Mon Sep 17 00:00:00 2001
-From: Cheyenne Wills <cwills@sinenomine.net>
-Date: Tue, 29 Aug 2023 14:58:10 -0600
-Subject: [PATCH] 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
----
-
-diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
-index dd8b39d..fb62752 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 @@
-     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 8119549..1457255 100644
---- a/src/cf/linux-kernel-func.m4
-+++ b/src/cf/linux-kernel-func.m4
-@@ -225,6 +225,16 @@
-     		     #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 ce7037e..2824ec1 100644
---- a/src/cf/linux-kernel-struct.m4
-+++ b/src/cf/linux-kernel-struct.m4
-@@ -26,6 +26,7 @@
- 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])
diff --git a/4f1d810.diff b/4f1d810.diff
new file mode 100644
index 0000000..9e01f56
--- /dev/null
+++ b/4f1d810.diff
@@ -0,0 +1,84 @@
+From 4f1d8104d17d2b4e95c7abaf5498db6b80aefa8f Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Mon, 18 Sep 2023 12:23:01 -0600
+Subject: [PATCH] Linux 6.6: Pass request_mask to generic_fillattr
+
+The Linux 6.6 commit: "fs: pass the request_mask to generic_fillattr"
+(0d72b92883) added an additional parameter to Linux's
+generic_fillattr() function.
+
+For openafs, generic_fillattr() is called from the inode_operations
+method "getattr", which is implemented in afs_linux_getattr(). The value
+for the request_mask parameter is an existing parameter that is passed
+to the inode_operations "getattr" method.
+
+Add an autoconf test for 4 parameters to the generic_fillattr function
+and update afs_linux_getattr() to pass the request_mask to
+generic_fillattr().
+
+Reviewed-on: https://gerrit.openafs.org/15561
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Tested-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 4fed232b80fb1ad6c0e1dfb42ed8d8e1e6821dd7)
+
+Change-Id: I5cddc56c5e605a6c5e4f7f3691eafec8ca589d2c
+Reviewed-on: https://gerrit.openafs.org/15590
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
+Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
+---
+
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 932fd9d..d5fab97 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -1195,7 +1195,11 @@
+ {
+ 	int err = afs_linux_revalidate(path->dentry);
+ 	if (!err) {
++# if defined(GENERIC_FILLATTR_TAKES_REQUEST_MASK)
++		generic_fillattr(afs_mnt_idmap, request_mask, path->dentry->d_inode, stat);
++# else
+ 		generic_fillattr(afs_mnt_idmap, path->dentry->d_inode, stat);
++# endif
+ 	}
+ 	return err;
+ }
+diff --git a/src/cf/linux-kernel-assorted.m4 b/src/cf/linux-kernel-assorted.m4
+index b3a11bc..49827d5 100644
+--- a/src/cf/linux-kernel-assorted.m4
++++ b/src/cf/linux-kernel-assorted.m4
+@@ -58,6 +58,7 @@
+ LINUX_D_INVALIDATE_IS_VOID
+ LINUX_KERNEL_READ_OFFSET_IS_LAST
+ LINUX_KEYRING_SEARCH_TAKES_RECURSE
++LINUX_GENERIC_FILLATTR_TAKES_REQUEST_MASK
+ ])
+ 
+ 
+diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
+index 1e4dcaf..3596b6a 100644
+--- a/src/cf/linux-test4.m4
++++ b/src/cf/linux-test4.m4
+@@ -854,3 +854,16 @@
+                        [define if your keyring_search has the recurse parameter],
+                        [])
+ ])
++
++dnl Linux 6.6 added the 'request_mask' parameter to generic_fillattr.
++AC_DEFUN([LINUX_GENERIC_FILLATTR_TAKES_REQUEST_MASK], [
++  AC_CHECK_LINUX_BUILD([whether generic_fillattr has the request_mask parameter],
++                       [ac_cv_linux_func_generic_fillattr_takes_request_mask],
++                       [#include <linux/fs.h>],
++                       [
++                       generic_fillattr(NULL, 0, NULL, NULL);
++                       ],
++                       [GENERIC_FILLATTR_TAKES_REQUEST_MASK],
++                       [define if your generic_fillattr has the request_mask_parameter],
++                       [])
++])
diff --git a/5b647bf.diff b/5b647bf.diff
new file mode 100644
index 0000000..b9c1f74
--- /dev/null
+++ b/5b647bf.diff
@@ -0,0 +1,55 @@
+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
diff --git a/6413fdb.diff b/6413fdb.diff
new file mode 100644
index 0000000..560caf7
--- /dev/null
+++ b/6413fdb.diff
@@ -0,0 +1,97 @@
+From 6413fdbc913834f2884989e5811841f4ccea2b5f Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Thu, 05 Oct 2023 14:44:49 -0600
+Subject: [PATCH] Linux 6.6: convert to ctime accessor functions
+
+The Linux 6.6 commit "fs: add ctime accessors infrastructure"
+(9b6304c1d5) added accessor functions for an inode's ctime member.
+A follow on commit "fs: rename i_ctime field to __i_ctime" (13bc244578)
+changed the name of the inode member ctime to __i_ctime to indicate it's
+a private member.
+
+Add an autoconf test for the ctime accessor function
+'inode_set_ctime()'.
+
+Add an afs_inode_set_ctime to LINUX/osi_machdep.h that is either defined
+as a macro to Linux's inode_set_ctime, or implements a static inline
+function to set a inode's ctime.
+
+Convert the setting of an inode's ctime to use afs_inode_set_ctime().
+
+For more information behind the Linux change, see the commit message
+for:
+ "Merge tag 'v6.6-vfs.ctime'
+  of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs" (615e95831)
+
+Reviewed-on: https://gerrit.openafs.org/15560
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Tested-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 072c7934cd1b99052882f02294f7036d422b6cf1)
+
+ Conflicts:
+	src/cf/linux-kernel-func.m4 (context)
+
+Change-Id: I729408d12a7946f5778b036ca7e2c14299f3ce8e
+Reviewed-on: https://gerrit.openafs.org/15589
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
+Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
+---
+
+diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h
+index 2220e05..f9ceb35 100644
+--- a/src/afs/LINUX/osi_machdep.h
++++ b/src/afs/LINUX/osi_machdep.h
+@@ -118,6 +118,17 @@
+ }
+ #endif
+ 
++#if defined(HAVE_LINUX_INODE_SET_CTIME)
++# define afs_inode_set_ctime(inode, sec, nsec) inode_set_ctime((inode), (sec), (nsec))
++#else
++static inline void
++afs_inode_set_ctime(struct inode *inode, time64_t sec, long nsec)
++{
++    inode->i_ctime.tv_sec = sec;
++    inode->i_ctime.tv_nsec = nsec;
++}
++#endif
++
+ #undef gop_lookupname
+ #define gop_lookupname osi_lookupname
+ 
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index fb62752..932fd9d 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -1144,8 +1144,7 @@
+      * any time the sysname list changes.
+      */
+     ip->i_mtime.tv_nsec = afs_sysnamegen;
+-    ip->i_ctime.tv_sec = vp->va_ctime.tv_sec;
+-    ip->i_ctime.tv_nsec = 0;
++    afs_inode_set_ctime(ip, vp->va_ctime.tv_sec, 0);
+ }
+ 
+ /* afs_notify_change
+diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
+index 105e58c..dc26b60 100644
+--- a/src/cf/linux-kernel-func.m4
++++ b/src/cf/linux-kernel-func.m4
+@@ -238,6 +238,12 @@
+     		     #include <linux/fs.h>],
+     		    [(void)wrap_directory_iterator(NULL, NULL, NULL);])
+ 
++dnl Linux 6.6 requires the use of a getter/setter for accessing a inode's
++dnl ctime member.  Test for the setter inode_set_ctime
++AC_CHECK_LINUX_FUNC([inode_set_ctime],
++		    [#include <linux/fs.h>],
++		    [inode_set_ctime(NULL, 0, 0);])
++
+ 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/6de0a64.diff b/6de0a64.diff
new file mode 100644
index 0000000..eb97b8c
--- /dev/null
+++ b/6de0a64.diff
@@ -0,0 +1,118 @@
+From 6de0a646036283266e1d4aeb583e426005ca5ad4 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Tue, 29 Aug 2023 14:58:10 -0600
+Subject: [PATCH] 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
+Reviewed-on: https://gerrit.openafs.org/15558
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
+Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
+---
+
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index dd8b39d..fb62752 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 @@
+     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 b913676..105e58c 100644
+--- a/src/cf/linux-kernel-func.m4
++++ b/src/cf/linux-kernel-func.m4
+@@ -228,6 +228,16 @@
+ 		    [[static struct ctl_table cf_sysctl_table[1];
+ 		    (void)register_sysctl(NULL, cf_sysctl_table);]])
+ 
++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 ce7037e..2824ec1 100644
+--- a/src/cf/linux-kernel-struct.m4
++++ b/src/cf/linux-kernel-struct.m4
+@@ -26,6 +26,7 @@
+ 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])
diff --git a/openafs.changes b/openafs.changes
index 801b5ec..39a3629 100644
--- a/openafs.changes
+++ b/openafs.changes
@@ -1,4 +1,16 @@
 -------------------------------------------------------------------
+Fri Nov 10 08:53:16 UTC 2023 - Christof Hanke <christof.hanke@mpcdf.mpg.de>
+
+- 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.diff for branch openafs-stable-1_8_x
+  
+
+-------------------------------------------------------------------
 Mon Oct  2 07:29:50 UTC 2023 - Christof Hanke <christof.hanke@mpcdf.mpg.de>
 
 - apply upstream-patches for kernel 6.5: 
diff --git a/openafs.spec b/openafs.spec
index 6f88c8e..3d5d387 100644
--- a/openafs.spec
+++ b/openafs.spec
@@ -108,7 +108,11 @@ Patch1:         fef2457.diff
 Patch2:         d15c7ab.diff
 Patch3:         63801cf.diff
 Patch4:         538f450.diff
-Patch5:         474750a.diff
+Patch6:         6de0a64.diff
+# PATCH-FIX-UPSTREAM fix build with kernel 6.6
+Patch5:         5b647bf.diff
+Patch7:         6413fdb.diff
+Patch8:         4f1d810.diff
 
 #	GENERAL BuildRequires and Requires
 #
@@ -324,6 +328,9 @@ done
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
 
 ./regen.sh