summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lass2020-07-21 22:15:01 +0200
committerMichael Lass2020-07-21 22:15:01 +0200
commit5b5aa46d82852b3d6210d71f5b01d7407705940d (patch)
treeaf6a306ab213ffb4e99721ad5eeb2518b227a7d9
parentb2005ecaebc9c2caf0009e3fb9c3a32df8da2c13 (diff)
downloadaur-5b5aa46d82852b3d6210d71f5b01d7407705940d.tar.gz
Prepare for Linux 5.8
-rw-r--r--.SRCINFO10
-rw-r--r--0001-Temporary-fix-for-compilation-with-GCC-10.patch6
-rw-r--r--0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch159
-rw-r--r--0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch49
-rw-r--r--0004-LINUX-5.8-use-lru_cache_add.patch108
-rw-r--r--PKGBUILD19
6 files changed, 342 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 9b3778baa59..122e0bd8ea7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = openafs-modules-dkms
pkgdesc = Kernel module for OpenAFS (dkms)
pkgver = 1.8.6
- pkgrel = 1
+ pkgrel = 2
url = http://www.openafs.org
arch = i686
arch = x86_64
@@ -18,9 +18,15 @@ pkgbase = openafs-modules-dkms
source = http://openafs.org/dl/openafs/1.8.6/openafs-1.8.6-src.tar.bz2
source = dkms.conf
source = 0001-Temporary-fix-for-compilation-with-GCC-10.patch
+ source = 0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch
+ source = 0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch
+ source = 0004-LINUX-5.8-use-lru_cache_add.patch
sha256sums = 8b4e9d3180f1ecd752753da17ac630df04eb7007c90a921a5f6403c0339d2945
sha256sums = 5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0
- sha256sums = b067b59bf856d15ded1ee786d303eb7b7ff47edb5b3e078b1d43862b8db62368
+ sha256sums = 3d0bf6960ef1eaab87492e93ea36c3b1a6b1e12877863abd7b64ad78e4637bce
+ sha256sums = 5c02f2c152720bc790dfdf5f99b083b986acd34074da917efa9f39265eda7483
+ sha256sums = 4373b0509c1eb7f4aec4cb11a231571f1015cdf3bef6e059c0df9e493e178e83
+ sha256sums = 955f710fff9f535406800406bf128deccc209511b0aa9b6aacb6f3b4417a6a4d
pkgname = openafs-modules-dkms
diff --git a/0001-Temporary-fix-for-compilation-with-GCC-10.patch b/0001-Temporary-fix-for-compilation-with-GCC-10.patch
index 65a310e73bd..9a9ce50e1cf 100644
--- a/0001-Temporary-fix-for-compilation-with-GCC-10.patch
+++ b/0001-Temporary-fix-for-compilation-with-GCC-10.patch
@@ -1,7 +1,7 @@
-From 240278523907c8a0e733620d6acf7b3933d5cbdb Mon Sep 17 00:00:00 2001
+From 81c4f50914bd0f696a0a6c356982e97594bd2c77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20La=C3=9F?= <lass@mail.uni-paderborn.de>
Date: Tue, 19 May 2020 16:17:01 +0200
-Subject: [PATCH 1/3] Temporary fix for compilation with GCC 10
+Subject: [PATCH 1/4] Temporary fix for compilation with GCC 10
See:
* https://bugs.gentoo.org/706738
@@ -16,7 +16,7 @@ Change-Id: I0bbf317dcf584d5531db714c5e9b986f3fbb6a0b
1 file changed, 2 insertions(+)
diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4
-index 29a79d7ce..ac11e9310 100644
+index 5f0d73fc2..7cf761757 100644
--- a/src/cf/osconf.m4
+++ b/src/cf/osconf.m4
@@ -681,6 +681,8 @@ if test "x$GCC" = "xyes"; then
diff --git a/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch b/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch
new file mode 100644
index 00000000000..07bd4a72b59
--- /dev/null
+++ b/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch
@@ -0,0 +1,159 @@
+From 858ce410250bae8c5043b8277aa3941dd528d577 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 3 Jul 2020 10:33:51 -0600
+Subject: [PATCH 2/4] LINUX 5.8: Replace kernel_setsockopt with new funcs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Linux 5.8-rc1 commit 'net: remove kernel_setsockopt' (5a892ff2facb)
+retires the kernel_setsockopt function. In prior kernel commits new
+functions (ip_sock_set_*) were added to replace the specific functions
+performed by kernel_setsockopt.
+
+Define new config test 'HAVE_IP_SOCK_SET' if the 'ip_sock_set' functions
+are available. The config define 'HAVE_KERNEL_SETSOCKOPT' is no longer
+set in Linux 5.8.
+
+Create wrapper functions that replace the kernel_setsockopt calls with
+calls to the appropriate Linux kernel function(s) (depending on what
+functions the kernel supports).
+
+Remove the unused 'kernel_getsockopt' function (used for building with
+pre 2.6.19 kernels).
+
+For reference
+ Linux 2.6.19 introduced kernel_setsockopt
+ Linux 5.8 removed kernel_setsockopt and replaced the functionality
+ with a set of new functions (ip_sock_set_*)
+
+Reviewed-on: https://gerrit.openafs.org/14247
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit c48072b9800759ef1682b91ff1e962f6904a2594)
+
+Change-Id: I2724fad06b1882149d2066d13eced55eff5ee695
+Reviewed-on: https://gerrit.openafs.org/14267
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
+Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
+---
+ src/afs/LINUX/osi_compat.h | 43 +++++++++++++++++++++++++------------
+ src/cf/linux-kernel-func.m4 | 6 ++++++
+ src/rx/LINUX/rx_knet.c | 11 +++-------
+ 3 files changed, 38 insertions(+), 22 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
+index 4999b89b9..620b3730c 100644
+--- a/src/afs/LINUX/osi_compat.h
++++ b/src/afs/LINUX/osi_compat.h
+@@ -314,9 +314,22 @@ zero_user_segment(struct page *pp, unsigned int from1, unsigned int to1)
+ }
+ #endif
+
+-#ifndef HAVE_LINUX_KERNEL_SETSOCKOPT
++#if defined(HAVE_LINUX_IP_SOCK_SET)
++# include <net/ip.h>
++/* ip_sock_set_* introduced in linux 5.8 */
++static inline void
++afs_linux_sock_set_mtu_discover(struct socket *sockp, int pmtu)
++{
++ ip_sock_set_mtu_discover(sockp->sk, pmtu);
++}
++static inline void
++afs_linux_sock_set_recverr(struct socket *sockp)
++{
++ ip_sock_set_recverr(sockp->sk);
++}
++#else
++# if !defined(HAVE_LINUX_KERNEL_SETSOCKOPT)
+ /* Available from 2.6.19 */
+-
+ static inline int
+ kernel_setsockopt(struct socket *sockp, int level, int name, char *val,
+ unsigned int len) {
+@@ -329,20 +342,22 @@ kernel_setsockopt(struct socket *sockp, int level, int name, char *val,
+
+ return ret;
+ }
++# endif /* !HAVE_LINUX_KERNEL_SETSOCKOPT */
+
+-static inline int
+-kernel_getsockopt(struct socket *sockp, int level, int name, char *val,
+- int *len) {
+- mm_segment_t old_fs = get_fs();
+- int ret;
+-
+- set_fs(get_ds());
+- ret = sockp->ops->getsockopt(sockp, level, name, val, len);
+- set_fs(old_fs);
+-
+- return ret;
++static inline void
++afs_linux_sock_set_mtu_discover(struct socket *sockp, int pmtu)
++{
++ kernel_setsockopt(sockp, SOL_IP, IP_MTU_DISCOVER, (char *)&pmtu,
++ sizeof(pmtu));
+ }
+-#endif
++static inline void
++afs_linux_sock_set_recverr(struct socket *sockp)
++{
++ int recverr = 1;
++ kernel_setsockopt(sockp, SOL_IP, IP_RECVERR, (char *)&recverr,
++ sizeof(recverr));
++}
++#endif /* !HAVE_LINUX_IP_SOCK_SET */
+
+ #ifdef HAVE_TRY_TO_FREEZE
+ static inline int
+diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
+index 07627db52..78ff48294 100644
+--- a/src/cf/linux-kernel-func.m4
++++ b/src/cf/linux-kernel-func.m4
+@@ -151,6 +151,12 @@ AC_CHECK_LINUX_FUNC([lru_cache_add_file],
+ [#include <linux/swap.h>],
+ [lru_cache_add_file(NULL);])
+
++dnl Linux 5.8 replaced kernel_setsockopt with helper functions
++dnl e.g. ip_sock_set_mtu_discover, ip_sock_set_recverr
++AC_CHECK_LINUX_FUNC([ip_sock_set],
++ [#include <net/ip.h>],
++ [ip_sock_set_mtu_discover(NULL, 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/src/rx/LINUX/rx_knet.c b/src/rx/LINUX/rx_knet.c
+index 9fbb563f3..50607c8f5 100644
+--- a/src/rx/LINUX/rx_knet.c
++++ b/src/rx/LINUX/rx_knet.c
+@@ -34,7 +34,6 @@
+ #include <linux/errqueue.h>
+ #include <linux/icmp.h>
+ #endif
+-
+ #include "osi_compat.h"
+
+ /* rxk_NewSocket
+@@ -76,14 +75,10 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport)
+ return NULL;
+ }
+
+- kernel_setsockopt(sockp, SOL_IP, IP_MTU_DISCOVER, (char *)&pmtu,
+- sizeof(pmtu));
++ afs_linux_sock_set_mtu_discover(sockp, pmtu);
++
+ #ifdef AFS_RXERRQ_ENV
+- {
+- int recverr = 1;
+- kernel_setsockopt(sockp, SOL_IP, IP_RECVERR, (char *)&recverr,
+- sizeof(recverr));
+- }
++ afs_linux_sock_set_recverr(sockp);
+ #endif
+ return (osi_socket *)sockp;
+ }
+--
+2.27.0
+
diff --git a/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch b/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch
new file mode 100644
index 00000000000..9bed0a8166a
--- /dev/null
+++ b/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch
@@ -0,0 +1,49 @@
+From c8d51224d54275ac34f9bb4d817842e73e777b14 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 3 Jul 2020 10:34:42 -0600
+Subject: [PATCH 3/4] LINUX 5.8: do not set name field in backing_dev_info
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Linux-5.8-rc1 commit 'bdi: remove the name field in struct
+backing_dev_info' (1cd925d5838)
+
+Do not set the name field in the backing_dev_info structure if it is
+not available. Uses an existing config test
+ 'STRUCT_BACKING_DEV_INFO_HAS_NAME'
+
+Note the name field in the backing_dev_info structure was added in
+Linux-2.6.32
+
+Reviewed-on: https://gerrit.openafs.org/14248
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit d8ec294534fcdee77a2ccd297b4b167dc4d5573d)
+
+Change-Id: I3d9e18092db998a4c4f26bd63ee3b75383a53d4c
+Reviewed-on: https://gerrit.openafs.org/14268
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
+Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
+---
+ src/afs/LINUX/osi_vfsops.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c
+index 8bbb5f225..ca1d5c83b 100644
+--- a/src/afs/LINUX/osi_vfsops.c
++++ b/src/afs/LINUX/osi_vfsops.c
+@@ -121,7 +121,9 @@ afs_fill_super(struct super_block *sb, void *data, int silent)
+ code = super_setup_bdi(sb);
+ if (code)
+ goto out;
++# if defined(STRUCT_BACKING_DEV_INFO_HAS_NAME)
+ sb->s_bdi->name = "openafs";
++# endif
+ sb->s_bdi->ra_pages = 32;
+ #else
+ /* used for inodes backing_dev_info field, also */
+--
+2.27.0
+
diff --git a/0004-LINUX-5.8-use-lru_cache_add.patch b/0004-LINUX-5.8-use-lru_cache_add.patch
new file mode 100644
index 00000000000..b4a49c6cbb8
--- /dev/null
+++ b/0004-LINUX-5.8-use-lru_cache_add.patch
@@ -0,0 +1,108 @@
+From db3408925dd69a70c14249a97d178d2762329f15 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 3 Jul 2020 10:35:06 -0600
+Subject: [PATCH 4/4] LINUX 5.8: use lru_cache_add
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+With Linux-5.8-rc1 commit 'mm: fold and remove lru_cache_add_anon() and
+lru_cache_add_file()' (6058eaec), the lru_cache_add_file function is
+removed since it was functionally equivalent to lru_cache_add.
+
+Replace lru_cache_add_file with lru_cache_add.
+
+Introduce a new autoconf test to determine if lru_cache_add is present
+
+For reference, the Linux changes associated with the lru caches:
+
+ __pagevec_lru_add introduced before v2.6.12-rc2
+
+ lru_cache_add_file introduced in v2.6.28-rc1
+ __pagevec_lru_add_file replaces __pagevec_lru_add in v2.6.28-rc1
+ vmscan: split LRU lists into anon & file sets (4f98a2fee)
+
+ __pagevec_lru_add removed in v5.7 with a note to use lru_cache_add_file
+ mm/swap.c: not necessary to export __pagevec_lru_add() (bde07cfc6)
+
+ lru_cache_add_file removed in v5.8
+ mm: fold and remove lru_cache_add_anon() and lru_cache_add_file()
+ (6058eaec)
+ lru_cache_add exported
+ mm: fold and remove lru_cache_add_anon() and lru_cache_add_file()
+ (6058eaec)
+
+Openafs will use:
+ lru_cache_add on 5.8 kernels
+ lru_cache_add_file from 2.6.28 through 5.7 kernels
+ __pagevec_lru_add/__pagevec_lru_add_file on pre 2.6.28 kernels
+
+Reviewed-on: https://gerrit.openafs.org/14249
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Yadavendra Yadav <yadayada@in.ibm.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 7d85ce221d6ccc19cf76ce7680c74311e4ed2632)
+
+Change-Id: Iba6ef4441687dbf60d227a708e2a032c2c0dc79f
+Reviewed-on: https://gerrit.openafs.org/14269
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
+Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
+---
+ src/afs/LINUX/osi_vnodeops.c | 8 +++++++-
+ src/cf/linux-kernel-func.m4 | 7 +++++++
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 00995b27a..36a4f685e 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -71,7 +71,7 @@ extern struct vcache *afs_globalVp;
+
+ /* Handle interfacing with Linux's pagevec/lru facilities */
+
+-#if defined(HAVE_LINUX_LRU_CACHE_ADD_FILE)
++#if defined(HAVE_LINUX_LRU_CACHE_ADD_FILE) || defined(HAVE_LINUX_LRU_CACHE_ADD)
+
+ /*
+ * Linux's lru_cache_add_file provides a simplified LRU interface without
+@@ -90,7 +90,13 @@ afs_lru_cache_init(struct afs_lru_pages *alrupages)
+ static inline void
+ afs_lru_cache_add(struct afs_lru_pages *alrupages, struct page *page)
+ {
++# if defined(HAVE_LINUX_LRU_CACHE_ADD)
++ lru_cache_add(page);
++# elif defined(HAVE_LINUX_LRU_CACHE_ADD_FILE)
+ lru_cache_add_file(page);
++# else
++# error need a kernel function to add a page to the kernel lru cache
++# endif
+ }
+
+ static inline void
+diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
+index 78ff48294..11d071806 100644
+--- a/src/cf/linux-kernel-func.m4
++++ b/src/cf/linux-kernel-func.m4
+@@ -147,10 +147,17 @@ AC_CHECK_LINUX_FUNC([inode_lock],
+ [inode_lock(NULL);])
+
+ dnl lru_cache_add_file added to Linux 2.6.28.
++dnl removed in Linux 5.8
+ AC_CHECK_LINUX_FUNC([lru_cache_add_file],
+ [#include <linux/swap.h>],
+ [lru_cache_add_file(NULL);])
+
++dnl lru_cache_add exported in Linux 5.8
++dnl replaces lru_cache_add_file
++AC_CHECK_LINUX_FUNC([lru_cache_add],
++ [#include <linux/swap.h>],
++ [lru_cache_add(NULL);])
++
+ dnl Linux 5.8 replaced kernel_setsockopt with helper functions
+ dnl e.g. ip_sock_set_mtu_discover, ip_sock_set_recverr
+ AC_CHECK_LINUX_FUNC([ip_sock_set],
+--
+2.27.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 41cecd721ff..a1c8ff1ad28 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,7 +7,7 @@
pkgname=openafs-modules-dkms
_srcname=openafs
pkgver=1.8.6
-pkgrel=1
+pkgrel=2
pkgdesc="Kernel module for OpenAFS (dkms)"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.openafs.org"
@@ -18,16 +18,27 @@ conflicts=('openafs-features-libafs' 'openafs-modules' 'openafs<1.6.6-2')
options=(!emptydirs)
source=("http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2"
"dkms.conf"
- 0001-Temporary-fix-for-compilation-with-GCC-10.patch)
+ 0001-Temporary-fix-for-compilation-with-GCC-10.patch
+ 0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch
+ 0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch
+ 0004-LINUX-5.8-use-lru_cache_add.patch)
sha256sums=('8b4e9d3180f1ecd752753da17ac630df04eb7007c90a921a5f6403c0339d2945'
'5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0'
- 'b067b59bf856d15ded1ee786d303eb7b7ff47edb5b3e078b1d43862b8db62368')
+ '3d0bf6960ef1eaab87492e93ea36c3b1a6b1e12877863abd7b64ad78e4637bce'
+ '5c02f2c152720bc790dfdf5f99b083b986acd34074da917efa9f39265eda7483'
+ '4373b0509c1eb7f4aec4cb11a231571f1015cdf3bef6e059c0df9e493e178e83'
+ '955f710fff9f535406800406bf128deccc209511b0aa9b6aacb6f3b4417a6a4d')
prepare() {
cd "${srcdir}/${_srcname}-${pkgver}"
# Fix compilation with GCC 10 (see https://bugs.gentoo.org/706738 and https://gerrit.openafs.org/14106)
- patch -p1 < "${srcdir}/0001-Temporary-fix-for-compilation-with-GCC-10.patch"
+ patch -p1 < "${srcdir}"/0001-Temporary-fix-for-compilation-with-GCC-10.patch
+
+ # Compatibility with Linux 5.8
+ patch -p1 < "${srcdir}"/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch
+ patch -p1 < "${srcdir}"/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch
+ patch -p1 < "${srcdir}"/0004-LINUX-5.8-use-lru_cache_add.patch
# Only needed when changes to configure were made
./regen.sh -q