diff --git a/474750a.diff b/474750a.diff new file mode 100644 index 0000000..71a4558 --- /dev/null +++ b/474750a.diff @@ -0,0 +1,113 @@ +From 474750a2008b2de37a05d6e51b31447d3a721dd4 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills +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 +Reviewed-by: Andrew Deason +Tested-by: BuildBot +(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 ], + [(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 ++ #include ], ++ [(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/538f450.diff b/538f450.diff new file mode 100644 index 0000000..f38eed6 --- /dev/null +++ b/538f450.diff @@ -0,0 +1,64 @@ +From 538f450033a67e251b473ff92238b3124b85fc72 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills +Date: Sun, 09 Jul 2023 18:45:15 -0600 +Subject: [PATCH] hcrypto: rename abort to _afscrypto_abort + +The Linux 6.5 commit: + panic: make function declarations visible (d9cdb43189) +added a declaration for abort into panic.h. + +When building the Linux kernel module, the build fails with the +following: + + src/crypto/hcrypto/kernel/config.h:95:20: error: static declaration of + ‘abort’ follows non-static declaration + 95 | static_inline void abort(void) {osi_Panic("hckernel aborting\n" + );} + | ^~~~~ + ... + from ./include/linux/wait.h:9, + from /openafs/src/afs/sysincludes.h:118, + from /openafs/src/crypto/hcrypto/kernel/config.h:30: + ./include/linux/panic.h:36:6: note: previous declaration of ‘abort’ + with type ‘void(void)’ + 36 | void abort(void); + | ^~~~~ + +Update the declaration in hcrypto/kernel/config.h to change the function +name from abort to _afscrypto_abort and use a preprocessor define to +map abort to _afscrypto_abort. + +Reviewed-on: https://gerrit.openafs.org/15501 +Reviewed-by: Andrew Deason +Reviewed-by: Michael Meffie +Reviewed-by: Benjamin Kaduk +Tested-by: Benjamin Kaduk +(cherry picked from commit c4c16890d9d2829f6bef1ef58feafb30b1d59da3) + +Change-Id: I54cc9156b98320d04fe6f7bb595a150d5ba87b49 +Reviewed-on: https://gerrit.openafs.org/15523 +Tested-by: BuildBot +Reviewed-by: Michael Meffie +Reviewed-by: Mark Vitale +Reviewed-by: Stephan Wiesand +--- + +diff --git a/src/crypto/hcrypto/kernel/config.h b/src/crypto/hcrypto/kernel/config.h +index 9623fa9..ea0f60b 100644 +--- a/src/crypto/hcrypto/kernel/config.h ++++ b/src/crypto/hcrypto/kernel/config.h +@@ -91,7 +91,13 @@ + static_inline pid_t getpid(void) {return 1;}; + #endif + static_inline int open(const char *path, int flags, ...) {return -1;} +-static_inline void abort(void) {osi_Panic("hckernel aborting\n");} ++ ++#ifdef abort ++# undef abort ++#endif ++#define abort _afscrypto_abort ++static_inline void _afscrypto_abort(void) {osi_Panic("hckernel aborting\n");} ++ + static_inline void rk_cloexec(int fd) {} + static_inline ssize_t read(int d, void *buf, size_t nbytes) {return -1;} + static_inline int close(int d) {return -1;} diff --git a/63801cf.diff b/63801cf.diff new file mode 100644 index 0000000..515e9b3 --- /dev/null +++ b/63801cf.diff @@ -0,0 +1,99 @@ +From 63801cfd1fc06ec3259fcfd67229f3a3c70447ed Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills +Date: Thu, 13 Jul 2023 10:54:22 -0600 +Subject: [PATCH] Linux 6.5: Use register_sysctl() + +The linux 6.5 commit: + "sysctl: Remove register_sysctl_table" (b8cbc0855a) +removed the Linux function register_sysctl_table(). The replacement +function is register_sysctl(), which offers a simpler interface. + +Add an autoconf test for the Linux function register_sysctl and add a +call to register_sysctl when available. + +Notes: +The Linux function register_sysctl was added in Linux 3.3 with the +commit: + 'sysctl: Add register_sysctl for normal sysctl users' (fea478d410) +with a note that it is a simpler interface. + +The function register_sysctl_table was marked as deprecated with the +Linux 6.3 commit: + 'proc_sysctl: enhance documentation' (1dc8689e4c) + +Reviewed-on: https://gerrit.openafs.org/15500 +Tested-by: BuildBot +Reviewed-by: Benjamin Kaduk +(cherry picked from commit fb31d299e6caa015f6288ba9186da6277d3d6a8d) + +Change-Id: I60f68f1dd95c32bada7179e98250fd44d7c2ddf3 +Reviewed-on: https://gerrit.openafs.org/15522 +Tested-by: BuildBot +Reviewed-by: Michael Meffie +Reviewed-by: Mark Vitale +Reviewed-by: Stephan Wiesand +--- + +diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c +index 894c494..a0a0398 100644 +--- a/src/afs/LINUX/osi_sysctl.c ++++ b/src/afs/LINUX/osi_sysctl.c +@@ -79,7 +79,7 @@ + .procname = 0 + } + }; +- ++# if !defined(HAVE_LINUX_REGISTER_SYSCTL) + static struct ctl_table fs_sysctl_table[] = { + { + AFS_SYSCTL_NAME(1) +@@ -91,11 +91,13 @@ + .procname = 0 + } + }; +- ++# endif + int + osi_sysctl_init(void) + { +-# if defined(REGISTER_SYSCTL_TABLE_NOFLAG) ++# if defined(HAVE_LINUX_REGISTER_SYSCTL) ++ afs_sysctl = register_sysctl("afs", afs_sysctl_table); ++# elif defined(REGISTER_SYSCTL_TABLE_NOFLAG) + afs_sysctl = register_sysctl_table(fs_sysctl_table); + # else + afs_sysctl = register_sysctl_table(fs_sysctl_table, 0); +diff --git a/src/cf/linux-kernel-assorted.m4 b/src/cf/linux-kernel-assorted.m4 +index 03d5f65..b3a11bc 100644 +--- a/src/cf/linux-kernel-assorted.m4 ++++ b/src/cf/linux-kernel-assorted.m4 +@@ -39,7 +39,9 @@ + LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK + LINUX_KEY_ALLOC_NEEDS_CRED + LINUX_INIT_WORK_HAS_DATA +-LINUX_REGISTER_SYSCTL_TABLE_NOFLAG ++dnl Don't bother checking register_sysctl_table if using register_sysctl ++AS_IF([test "x$ac_cv_linux_func_register_sysctl" != "xyes"], ++ [LINUX_REGISTER_SYSCTL_TABLE_NOFLAG]) + LINUX_HAVE_DCACHE_LOCK + LINUX_D_COUNT_IS_INT + LINUX_IOP_GETATTR_TAKES_PATH_STRUCT +diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4 +index ee22158..8119549 100644 +--- a/src/cf/linux-kernel-func.m4 ++++ b/src/cf/linux-kernel-func.m4 +@@ -217,6 +217,14 @@ + #include ], + [block_dirty_folio(NULL, NULL);]) + ++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 ++AC_CHECK_LINUX_FUNC([register_sysctl], ++ [#include ++ #include ], ++ [(void)register_sysctl(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/d15c7ab.diff b/d15c7ab.diff new file mode 100644 index 0000000..8e37263 --- /dev/null +++ b/d15c7ab.diff @@ -0,0 +1,312 @@ +From d15c7ab50c92671052cbe9a93b0440c81156d8aa Mon Sep 17 00:00:00 2001 +From: Andrew Deason +Date: Thu, 18 Jul 2019 22:56:48 -0500 +Subject: [PATCH] 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 +defining some new preprocessor macros. + +Reviewed-on: https://gerrit.openafs.org/13700 +Reviewed-by: Benjamin Kaduk +Tested-by: Benjamin Kaduk +(cherry picked from commit 1b0bb8a7fcbd69d513ed30bb76fd0693d1bd3319) + +Change-Id: Ib656634ed956b845c89656069aa297253acce785 +Reviewed-on: https://gerrit.openafs.org/15521 +Tested-by: BuildBot +Reviewed-by: Andrew Deason +Reviewed-by: Michael Meffie +Reviewed-by: Mark Vitale +Reviewed-by: Stephan Wiesand +--- + +diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c +index 8e7dd70..894c494 100644 +--- a/src/afs/LINUX/osi_sysctl.c ++++ b/src/afs/LINUX/osi_sysctl.c +@@ -18,6 +18,8 @@ + #include + #endif + ++#ifdef CONFIG_SYSCTL ++ + /* From afs_util.c */ + extern afs_int32 afs_md5inum; + +@@ -31,206 +33,48 @@ + extern afs_int32 afs_pct1; + extern afs_int32 afs_pct2; + +-#ifdef CONFIG_SYSCTL ++# ifdef STRUCT_CTL_TABLE_HAS_CTL_NAME ++# ifdef CTL_UNNUMBERED ++# define AFS_SYSCTL_NAME(num) .ctl_name = CTL_UNNUMBERED, ++# else ++# define AFS_SYSCTL_NAME(num) .ctl_name = num, ++# endif ++# else ++# define AFS_SYSCTL_NAME(num) ++# endif ++ ++# define AFS_SYSCTL_INT2(num, perms, name, var) { \ ++ AFS_SYSCTL_NAME(num) \ ++ .procname = name, \ ++ .data = &var, \ ++ .maxlen = sizeof(var), \ ++ .mode = perms, \ ++ .proc_handler = &proc_dointvec \ ++} ++# define AFS_SYSCTL_INT(num, perms, var) \ ++ AFS_SYSCTL_INT2(num, perms, #var, var) ++ + static struct ctl_table_header *afs_sysctl = NULL; + + static struct ctl_table afs_sysctl_table[] = { +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 1, +-#endif +-#endif +- .procname = "hm_retry_RO", +- .data = &hm_retry_RO, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 2, +-#endif +-#endif +- .procname = "hm_retry_RW", +- .data = &hm_retry_RW, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 3, +-#endif +-#endif +- .procname = "hm_retry_int", +- .data = &hm_retry_int, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 4, +-#endif +-#endif +- .procname = "GCPAGs", +- .data = &afs_gcpags, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 5, +-#endif +-#endif +- .procname = "rx_deadtime", +- .data = &afs_rx_deadtime, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 6, +-#endif +-#endif +- .procname = "bkVolPref", +- .data = &afs_bkvolpref, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 7, +-#endif +-#endif +- .procname = "afs_blocksUsed", +- .data = &afs_blocksUsed, +- .maxlen = sizeof(afs_int32), +- .mode = 0444, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 8, +-#endif +-#endif +- .procname = "afs_blocksUsed_0", +- .data = &afs_blocksUsed_0, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 9, +-#endif +-#endif +- .procname = "afs_blocksUsed_1", +- .data = &afs_blocksUsed_1, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 10, +-#endif +-#endif +- .procname = "afs_blocksUsed_2", +- .data = &afs_blocksUsed_2, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 11, +-#endif +-#endif +- .procname = "afs_pct1", +- .data = &afs_pct1, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 12, +-#endif +-#endif +- .procname = "afs_pct2", +- .data = &afs_pct2, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 13, +-#endif +-#endif +- .procname = "afs_cacheBlocks", +- .data = &afs_cacheBlocks, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, +- { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 14, +-#endif +-#endif +- .procname = "md5inum", +- .data = &afs_md5inum, +- .maxlen = sizeof(afs_int32), +- .mode = 0644, +- .proc_handler = &proc_dointvec +- }, ++ AFS_SYSCTL_INT(1, 0644, hm_retry_RO), ++ AFS_SYSCTL_INT(2, 0644, hm_retry_RW), ++ AFS_SYSCTL_INT(3, 0644, hm_retry_int), ++ ++ AFS_SYSCTL_INT2(4, 0644, "GCPAGs", afs_gcpags), ++ AFS_SYSCTL_INT2(5, 0644, "rx_deadtime", afs_rx_deadtime), ++ AFS_SYSCTL_INT2(6, 0644, "bkVolPref", afs_bkvolpref), ++ ++ AFS_SYSCTL_INT( 7, 0444, afs_blocksUsed), ++ AFS_SYSCTL_INT( 8, 0644, afs_blocksUsed_0), ++ AFS_SYSCTL_INT( 9, 0644, afs_blocksUsed_1), ++ AFS_SYSCTL_INT(10, 0644, afs_blocksUsed_2), ++ ++ AFS_SYSCTL_INT( 11, 0644, afs_pct1), ++ AFS_SYSCTL_INT( 12, 0644, afs_pct2), ++ AFS_SYSCTL_INT( 13, 0644, afs_cacheBlocks), ++ AFS_SYSCTL_INT2(14, 0644, "md5inum", afs_md5inum), ++ + { + .procname = 0 + } +@@ -238,13 +82,7 @@ + + static struct ctl_table fs_sysctl_table[] = { + { +-#if defined(STRUCT_CTL_TABLE_HAS_CTL_NAME) +-#if defined(CTL_UNNUMBERED) +- .ctl_name = CTL_UNNUMBERED, +-#else +- .ctl_name = 1, +-#endif +-#endif ++ AFS_SYSCTL_NAME(1) + .procname = "afs", + .mode = 0555, + .child = afs_sysctl_table +@@ -257,11 +95,11 @@ + int + osi_sysctl_init(void) + { +-#if defined(REGISTER_SYSCTL_TABLE_NOFLAG) ++# if defined(REGISTER_SYSCTL_TABLE_NOFLAG) + afs_sysctl = register_sysctl_table(fs_sysctl_table); +-#else ++# else + afs_sysctl = register_sysctl_table(fs_sysctl_table, 0); +-#endif ++# endif + if (!afs_sysctl) + return -1; + diff --git a/fef2457.diff b/fef2457.diff new file mode 100644 index 0000000..f1dc281 --- /dev/null +++ b/fef2457.diff @@ -0,0 +1,61 @@ +From fef245769366efe8694ddadd1e1f2ed5ef8608f4 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills +Date: Sun, 09 Jul 2023 18:52:23 -0600 +Subject: [PATCH] Linux 6.5: Replace generic_file_splice_read + +The Linux 6.5 commit: + 'splice: Remove generic_file_splice_read()' (c6585011bc) +replaces the function generic_file_splice_read() with the function +filemap_splice_read(). + +The Linux function 'filemap_splice_read()' was introduced with the +Linux 6.3 commits: + + 'splice: Add a func to do a splice from a buffered file without + ITER_PIPE' (07073eb01c) + 'splice: Export filemap/direct_splice_read()' (7c8e01ebf2) + +With updates in Linux 6.5: + 'splice: Fix filemap_splice_read() to use the correct inode' + (c37222082f) -- which fixes a problem in the code. + 'splice: Make filemap_splice_read() check s_maxbytes' (83aeff881e) + +Due to the fact that there could be problems with splice support prior +to Linux 6.5 (where filemap_splice_read()'s use was expanded to +additional filesystems other than just cifs), we only want to use +'filemap_splice_read()' in Linux 6.5 and later. + +The LINUX/osi_vnodeops.c file is updated to use 'filemap_splice_read()', +for Linux 6.5 and later, for the splice_read member of the +file_operations structure. + +Reviewed-on: https://gerrit.openafs.org/15486 +Tested-by: BuildBot +Reviewed-by: Andrew Deason +Reviewed-by: Benjamin Kaduk +(cherry picked from commit 0e06eb78f293bb295b0fe12da24abd8dc1160149) + +Change-Id: I3b5436234d275253a37987dc40a522ae8f3cae1e +Reviewed-on: https://gerrit.openafs.org/15520 +Tested-by: BuildBot +Reviewed-by: Michael Meffie +Reviewed-by: Mark Vitale +Reviewed-by: Stephan Wiesand +--- + +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index ccec382..dd8b39d 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -960,7 +960,11 @@ + # else + .splice_write = generic_file_splice_write, + # endif ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(6,5,0) ++ .splice_read = filemap_splice_read, ++# else + .splice_read = generic_file_splice_read, ++# endif + #endif + .release = afs_linux_release, + .fsync = afs_linux_fsync, diff --git a/openafs.changes b/openafs.changes index 070c78c..e25cb2d 100644 --- a/openafs.changes +++ b/openafs.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Oct 2 07:29:50 UTC 2023 - Christof Hanke + +- apply upstream-patches for kernel 6.5: + * 63801cf.diff + * d15c7ab.diff + * fef2457.diff + * 538f450.diff + * 474750a.diff + ------------------------------------------------------------------- Mon Jul 10 10:24:31 UTC 2023 - Christof Hanke diff --git a/openafs.spec b/openafs.spec index 0760341..127ea66 100644 --- a/openafs.spec +++ b/openafs.spec @@ -61,7 +61,7 @@ Name: openafs -Version: 1.8.10 +Version: 1.8.10.1 Release: 0 Summary: OpenAFS Distributed File System License: IPL-1.0 @@ -103,6 +103,13 @@ Source58: openafs.cacheinfo Source98: kmp_only.files Source99: openafs.changes +# PATCH-FIX-UPSTREAM fix build with kernel 6.5 +Patch1: fef2457.diff +Patch2: d15c7ab.diff +Patch3: 63801cf.diff +Patch4: 538f450.diff +Patch5: 474750a.diff + # GENERAL BuildRequires and Requires # @@ -312,6 +319,11 @@ for src_file in %{S:0} %{S:1}; do done %setup -q -n openafs-%{upstream_version} -T -b 0 -b 1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 ./regen.sh