summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Laß2021-05-02 14:10:32 +0200
committerMichael Laß2021-05-02 14:10:32 +0200
commit2c0fcd8e9b26cae95bf9fbd92508beedb4c629b7 (patch)
tree44a0ceb94c494b6604c37eea1918e551ef08f7d5
parent6e12ff010a73c6f610c37dc72668a001c710cab9 (diff)
downloadaur-2c0fcd8e9b26cae95bf9fbd92508beedb4c629b7.tar.gz
Prepare for Linux 5.12
-rw-r--r--.SRCINFO24
-rw-r--r--0001-Avoid-duplicate-definitions-of-globals.patch4
-rw-r--r--0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch4
-rw-r--r--0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch4
-rw-r--r--0004-LINUX-5.8-use-lru_cache_add.patch4
-rw-r--r--0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch4
-rw-r--r--0006-LINUX-Fix-includes-for-fatal_signal_pending-test.patch4
-rw-r--r--0007-Linux-Refactor-test-for-32bit-compat.patch4
-rw-r--r--0008-Linux-5.11-Test-32bit-compat-with-in_compat_syscall.patch4
-rw-r--r--0009-LINUX-Introduce-afs_d_path.patch67
-rw-r--r--0010-Linux-Create-wrapper-for-setattr_prepare.patch65
-rw-r--r--0011-Linux-5.12-Add-user_namespace-param-to-inode-ops.patch289
-rw-r--r--PKGBUILD31
13 files changed, 473 insertions, 35 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 63a0d33c2086..e2827ad22126 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = openafs-modules-dkms
pkgdesc = Kernel module for OpenAFS (dkms)
pkgver = 1.8.7
- pkgrel = 2
+ pkgrel = 3
url = http://www.openafs.org
arch = i686
arch = x86_64
@@ -25,16 +25,22 @@ pkgbase = openafs-modules-dkms
source = 0006-LINUX-Fix-includes-for-fatal_signal_pending-test.patch
source = 0007-Linux-Refactor-test-for-32bit-compat.patch
source = 0008-Linux-5.11-Test-32bit-compat-with-in_compat_syscall.patch
+ source = 0009-LINUX-Introduce-afs_d_path.patch
+ source = 0010-Linux-Create-wrapper-for-setattr_prepare.patch
+ source = 0011-Linux-5.12-Add-user_namespace-param-to-inode-ops.patch
sha256sums = 53543a561fce67714fec9f2a6bf408c5cc1d061c7dc9d1459458275e8ccbfa79
sha256sums = 5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0
- sha256sums = 89d423281ae4664467ff583d664cd014362f0f829f2bb1ef76809593626b55e0
- sha256sums = cceb2501cca12956644718c64db1c8c0e8d460afbbde302045427f0610b60a92
- sha256sums = 729f14132a917c2397f4dc713d31c74c0a278c7359c5dd4edc3758fb08e534c4
- sha256sums = 73b69cea6eef193457091090fe2c6ae090040537395618dcb47c770196bc14ef
- sha256sums = aef54d871c376648ef712e9cc224aa65ef012762a28778d53d509a72f99d174e
- sha256sums = 38eaec2c4e08d45b4aa130ec581ed1e265950553432d8dd878f99decc54416de
- sha256sums = c62380c6284f7da43234c7c2bea8503851cd455e0c06d688bbafb1d77cdbd476
- sha256sums = ebb0c7ddd0fde966e35c277c7474abc39772a1bbaa601e7a678c95aad31bfb48
+ sha256sums = 909ebe2f2f82187ec5c8bd19a385e310521dceedb0b0d5ce8413809a37fe5654
+ sha256sums = 2439b2f663feed02c526f4e34b2cdc2a1d5ad35f7223ade87508c1cf4359ee9c
+ sha256sums = e605d4e7154f9ccf4dec24fec27abe4e2947713f35dae6aa8698e5f8722609a7
+ sha256sums = 15b53b4ab0578eaa31f849670990e15949e67be8b330d7581825a5e8408953ed
+ sha256sums = ba8c81c035303cbcf204744516a83b66adac94384aaa59ea2ea1a619a41aa7c0
+ sha256sums = d078882d94adf881bac2e7955689931abe7ac443db86d85e0b60c72d8b27738e
+ sha256sums = 19ca49013e32824002e355a85df6e25028283a0b06a6409cc7d5cd9800fea488
+ sha256sums = 52d40f8a3b032a9fa0ae57bc15d3611bc652ff6e417a488eac4223cef0db9142
+ sha256sums = 457474e625565c28daa6d642b2416b4398b2b9fec3a8b90c048fc0460412a0ce
+ sha256sums = 76d73a55d3e8da63c9ead2cecdec1efbaeb78739bb5abf635a64380eeba35158
+ sha256sums = 8bc24efe33f06228134dd27e5c9a6832abb436e2fbe3fab09b529fed4a5b406c
pkgname = openafs-modules-dkms
diff --git a/0001-Avoid-duplicate-definitions-of-globals.patch b/0001-Avoid-duplicate-definitions-of-globals.patch
index 960bddf48a88..e166c6aa5f1a 100644
--- a/0001-Avoid-duplicate-definitions-of-globals.patch
+++ b/0001-Avoid-duplicate-definitions-of-globals.patch
@@ -1,7 +1,7 @@
From ac4debb46bc0b95ff2f98d416703bc8df60b8415 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri, 22 May 2020 12:16:48 -0600
-Subject: [PATCH 1/8] Avoid duplicate definitions of globals
+Subject: [PATCH 01/11] Avoid duplicate definitions of globals
GCC 10 changed a default flag from -fcommon to -fno-common. See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678 for some background.
@@ -349,5 +349,5 @@ index 853c2121e..d58ecf014 100644
printf("[%s] Returned from LWP_WaitProcess()\n", rn);
if (waitCode) {
--
-2.30.1
+2.31.1
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
index 43d5ee53caba..c503f043b90c 100644
--- a/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch
+++ b/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch
@@ -1,7 +1,7 @@
From 509169ed302741e2499fbb116ed08408c08d3999 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/8] LINUX 5.8: Replace kernel_setsockopt with new funcs
+Subject: [PATCH 02/11] LINUX 5.8: Replace kernel_setsockopt with new funcs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -155,5 +155,5 @@ index 9fbb563f3..50607c8f5 100644
return (osi_socket *)sockp;
}
--
-2.30.1
+2.31.1
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
index 42937a90daf8..83a7ac15b8fc 100644
--- 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
@@ -1,7 +1,7 @@
From 2daa3a8f5771539203d9eb8c4e23b01ed7c65a16 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/8] LINUX 5.8: do not set name field in backing_dev_info
+Subject: [PATCH 03/11] 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
@@ -45,5 +45,5 @@ index 8bbb5f225..ca1d5c83b 100644
#else
/* used for inodes backing_dev_info field, also */
--
-2.30.1
+2.31.1
diff --git a/0004-LINUX-5.8-use-lru_cache_add.patch b/0004-LINUX-5.8-use-lru_cache_add.patch
index 397c131c72ed..26e84c2ab12b 100644
--- a/0004-LINUX-5.8-use-lru_cache_add.patch
+++ b/0004-LINUX-5.8-use-lru_cache_add.patch
@@ -1,7 +1,7 @@
From d1c503f83a2cf85c6fbf7aab24728a5f0787c54c 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/8] LINUX 5.8: use lru_cache_add
+Subject: [PATCH 04/11] LINUX 5.8: use lru_cache_add
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -104,5 +104,5 @@ index 78ff48294..11d071806 100644
dnl e.g. ip_sock_set_mtu_discover, ip_sock_set_recverr
AC_CHECK_LINUX_FUNC([ip_sock_set],
--
-2.30.1
+2.31.1
diff --git a/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch b/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch
index e991702fef44..6a3890f5ad40 100644
--- a/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch
+++ b/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch
@@ -1,7 +1,7 @@
From c3b7278663c0e88daa611e7c1cc250e63639a496 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri, 21 Aug 2020 10:37:51 -0600
-Subject: [PATCH 5/8] LINUX 5.9: Remove HAVE_UNLOCKED_IOCTL/COMPAT_IOCTL
+Subject: [PATCH 05/11] LINUX 5.9: Remove HAVE_UNLOCKED_IOCTL/COMPAT_IOCTL
Linux-5.9-rc1 commit 'fs: remove the HAVE_UNLOCKED_IOCTL and
HAVE_COMPAT_IOCTL defines' (4e24566a) removed the two referenced macros
@@ -165,5 +165,5 @@ index 36a4f685e..ba4f1e6af 100644
.open = afs_linux_open,
.flush = afs_linux_flush,
--
-2.30.1
+2.31.1
diff --git a/0006-LINUX-Fix-includes-for-fatal_signal_pending-test.patch b/0006-LINUX-Fix-includes-for-fatal_signal_pending-test.patch
index 501beaf5e7cb..e1bbb742e1f6 100644
--- a/0006-LINUX-Fix-includes-for-fatal_signal_pending-test.patch
+++ b/0006-LINUX-Fix-includes-for-fatal_signal_pending-test.patch
@@ -1,7 +1,7 @@
From 95a8c71f80e6d0aa83297fedf9f808ee01c32623 Mon Sep 17 00:00:00 2001
From: Andrew Deason <adeason@sinenomine.net>
Date: Thu, 28 Jan 2021 16:59:47 -0600
-Subject: [PATCH 6/8] LINUX: Fix includes for fatal_signal_pending test
+Subject: [PATCH 06/11] LINUX: Fix includes for fatal_signal_pending test
Commit 8b6ae289 (LINUX: Avoid lookup ENOENT on fatal signals) added a
configure test for fatal_signal_pending(). However, this check fails
@@ -69,5 +69,5 @@ index 11d071806..e45a30540 100644
AC_CHECK_LINUX_FUNC([file_dentry],
[#include <linux/fs.h>],
--
-2.30.1
+2.31.1
diff --git a/0007-Linux-Refactor-test-for-32bit-compat.patch b/0007-Linux-Refactor-test-for-32bit-compat.patch
index 89137c7c8d06..2b3cc10561fd 100644
--- a/0007-Linux-Refactor-test-for-32bit-compat.patch
+++ b/0007-Linux-Refactor-test-for-32bit-compat.patch
@@ -1,7 +1,7 @@
From 7efd65a984e5b50904e556992f533c460d9fcf9e Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri, 29 Jan 2021 11:32:36 -0700
-Subject: [PATCH 7/8] Linux: Refactor test for 32bit compat
+Subject: [PATCH 07/11] Linux: Refactor test for 32bit compat
Refactor the preprocessor checks for determining the method to test for
32bit compatibility (64bit kernel performing work for a 32bit task) into
@@ -208,5 +208,5 @@ index ce6afdf9a..9414f38b8 100644
if (!code)
iparam32_to_iparam(&dst32, dst);
--
-2.30.1
+2.31.1
diff --git a/0008-Linux-5.11-Test-32bit-compat-with-in_compat_syscall.patch b/0008-Linux-5.11-Test-32bit-compat-with-in_compat_syscall.patch
index 87b7285fed0e..75dec912f6bc 100644
--- a/0008-Linux-5.11-Test-32bit-compat-with-in_compat_syscall.patch
+++ b/0008-Linux-5.11-Test-32bit-compat-with-in_compat_syscall.patch
@@ -1,7 +1,7 @@
From 2d85a5b7a1011386d66cc36512a54e80b6cfa515 Mon Sep 17 00:00:00 2001
From: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri, 22 Jan 2021 07:57:55 -0700
-Subject: [PATCH 8/8] Linux 5.11: Test 32bit compat with in_compat_syscall
+Subject: [PATCH 08/11] Linux 5.11: Test 32bit compat with in_compat_syscall
Linux 5.11 removed the TIF_IA32 thread flag with commit:
x86: Reclaim TIF_IA32 and TIF_X32 (8d71d2bf6efec)
@@ -94,5 +94,5 @@ index e45a30540..5b4060238 100644
dnl replaces lru_cache_add_file
AC_CHECK_LINUX_FUNC([lru_cache_add],
--
-2.30.1
+2.31.1
diff --git a/0009-LINUX-Introduce-afs_d_path.patch b/0009-LINUX-Introduce-afs_d_path.patch
new file mode 100644
index 000000000000..e289942fd807
--- /dev/null
+++ b/0009-LINUX-Introduce-afs_d_path.patch
@@ -0,0 +1,67 @@
+From e4d3ce24f759d6f099b5523fd34501b496fb88a5 Mon Sep 17 00:00:00 2001
+From: Andrew Deason <adeason@sinenomine.net>
+Date: Tue, 23 Jul 2019 13:50:31 -0500
+Subject: [PATCH 09/11] LINUX: Introduce afs_d_path
+
+Move our preprocessor logic around d_path into an osi_compat.h
+wrapper, called afs_d_path. This just makes it a little easier to use
+d_path, and moves a tiny bit of #ifdef cruft away from real code.
+
+Reviewed-on: https://gerrit.openafs.org/13721
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+(cherry picked from commit 4c4fb6e36634e5663c8be25acd4a1ac872e4738c)
+
+Change-Id: I08763c71006e4ac6f2bf88d8ac71941fc44e6ab8
+Reviewed-on: https://gerrit.openafs.org/14563
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
+---
+ src/afs/LINUX/osi_compat.h | 11 +++++++++++
+ src/afs/LINUX/osi_misc.c | 8 +-------
+ 2 files changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
+index 620b3730c..a1e7f21fb 100644
+--- a/src/afs/LINUX/osi_compat.h
++++ b/src/afs/LINUX/osi_compat.h
+@@ -737,4 +737,15 @@ afs_file_write(struct file *filp, char __user *buf, size_t len, loff_t *pos)
+ #endif
+ }
+
++static inline char*
++afs_d_path(struct dentry *dp, struct vfsmount *mnt, char *buf, int buflen)
++{
++#ifdef D_PATH_TAKES_STRUCT_PATH
++ afs_linux_path_t p = { .mnt = mnt, .dentry = dp };
++ return d_path(&p, buf, buflen);
++#else
++ return d_path(dp, mnt, buf, buflen);
++#endif
++}
++
+ #endif /* AFS_LINUX_OSI_COMPAT_H */
+diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c
+index 0e9336db6..aa5d5fc93 100644
+--- a/src/afs/LINUX/osi_misc.c
++++ b/src/afs/LINUX/osi_misc.c
+@@ -138,13 +138,7 @@ int osi_abspath(char *aname, char *buf, int buflen,
+ return -PTR_ERR(name);
+ code = osi_lookupname_internal(name, followlink, &mnt, &dp);
+ if (!code) {
+-#if defined(D_PATH_TAKES_STRUCT_PATH)
+- afs_linux_path_t p = { .mnt = mnt, .dentry = dp };
+- path = d_path(&p, buf, buflen);
+-#else
+- path = d_path(dp, mnt, buf, buflen);
+-#endif
+-
++ path = afs_d_path(dp, mnt, buf, buflen);
+ if (IS_ERR(path)) {
+ code = -PTR_ERR(path);
+ } else {
+--
+2.31.1
+
diff --git a/0010-Linux-Create-wrapper-for-setattr_prepare.patch b/0010-Linux-Create-wrapper-for-setattr_prepare.patch
new file mode 100644
index 000000000000..fe75325bc8a9
--- /dev/null
+++ b/0010-Linux-Create-wrapper-for-setattr_prepare.patch
@@ -0,0 +1,65 @@
+From 06c067eb25fafd8d18de204a3df430e114fc8871 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Mon, 8 Mar 2021 09:22:04 -0700
+Subject: [PATCH 10/11] Linux: Create wrapper for setattr_prepare
+
+Move call to setattr_prepare/inode_change_ok into an osi_compat.h
+wrapper called 'afs_setattr_prepare'. This moves some of the #if logic
+out of the mainline code.
+
+Reviewed-on: https://gerrit.openafs.org/14548
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 12ae2beeeb172cebdfa24d5ea149f73fd85541f8)
+
+Change-Id: I1c7806893daf2404a8b3ac1b5c88ca04e6409226
+Reviewed-on: https://gerrit.openafs.org/14564
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
+---
+ src/afs/LINUX/osi_compat.h | 10 ++++++++++
+ src/afs/LINUX/osi_file.c | 6 +-----
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
+index a1e7f21fb..3ac4d798d 100644
+--- a/src/afs/LINUX/osi_compat.h
++++ b/src/afs/LINUX/osi_compat.h
+@@ -748,4 +748,14 @@ afs_d_path(struct dentry *dp, struct vfsmount *mnt, char *buf, int buflen)
+ #endif
+ }
+
++static inline int
++afs_setattr_prepare(struct dentry *dp, struct iattr *newattrs)
++{
++#if defined(HAVE_LINUX_SETATTR_PREPARE)
++ return setattr_prepare(dp, newattrs);
++#else
++ return inode_change_ok(dp->d_inode, newattrs);
++#endif
++}
++
+ #endif /* AFS_LINUX_OSI_COMPAT_H */
+diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c
+index 5b0a0c01d..982cf47e7 100644
+--- a/src/afs/LINUX/osi_file.c
++++ b/src/afs/LINUX/osi_file.c
+@@ -205,11 +205,7 @@ osi_UFSTruncate(struct osi_file *afile, afs_int32 asize)
+ AFS_CURRENT_TIME(&newattrs.ia_ctime);
+
+ /* avoid notify_change() since it wants to update dentry->d_parent */
+-#ifdef HAVE_LINUX_SETATTR_PREPARE
+- code = setattr_prepare(file_dentry(afile->filp), &newattrs);
+-#else
+- code = inode_change_ok(inode, &newattrs);
+-#endif
++ code = afs_setattr_prepare(file_dentry(afile->filp), &newattrs);
+ if (!code)
+ code = afs_inode_setattr(afile, &newattrs);
+ if (!code)
+--
+2.31.1
+
diff --git a/0011-Linux-5.12-Add-user_namespace-param-to-inode-ops.patch b/0011-Linux-5.12-Add-user_namespace-param-to-inode-ops.patch
new file mode 100644
index 000000000000..001f1782df22
--- /dev/null
+++ b/0011-Linux-5.12-Add-user_namespace-param-to-inode-ops.patch
@@ -0,0 +1,289 @@
+From 1a5b57363724d221a9065bbb10f817485d0a8bc3 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 5 Mar 2021 16:31:03 -0700
+Subject: [PATCH 11/11] Linux 5.12: Add user_namespace param to inode ops
+
+The Linux commits:
+"fs: make helpers idmap mount aware" (549c72977) and
+"attr: handle idmapped mounts" (2f221d6f7) that were merged into
+Linux-5.12-rc1 cause a build failure when creating the kernel module.
+
+Several functions within the inode_operations structure had their
+signature updated to include a user_namespace parameter. This allows
+a filesystem to support idmapped mounts.
+
+OpenAFS only implements some of the changed functions.
+
+ LINUX/vnodeops function inode_operation
+ ===================== ===============
+ afs_notify_change setattr
+ afs_linux_getattr getattr
+ afs_linux_create create
+ afs_linux_symlink symlink
+ afs_linux_mkdir mkdir
+ afs_linux_rename rename
+ afs_linux_permission permission
+
+Update the autoconf tests to determine if the Linux kernel requires
+the user_namespace structure for inode_operations functions. If so,
+define a generic "IOP_TAKES_USER_NAMESPACE" macro.
+
+Update the above vnodeops functions to accept a 'struct user_namespace'
+parameter.
+
+When using the 'setattr_prepare' function a user namespace must be
+now provided. In order to provide compatibility as a non-idmapped mount
+filesystem the initial user namespace can be used. With OpenAFS, the
+initial user namespace obtained at kernel module load time is stored in
+a global variable 'afs_ns'.
+
+Update the call to setattr_prepare to pass the user namespace pointed
+to by the 'afs_ns' global variable.
+
+Update calls to setattr to pass the user namespace pointed to by
+the 'afs_ns' global variable.
+
+Notes:
+
+The changes introduced with Linux 5.12 allow a filesystem to support
+idmapped mounts if desired. This commit does not implement support for
+idmapped mounts, but will continue to use the same initial user
+namespace as prior to Linux 5.12.
+
+With Linux 5.12 the following autoconf checks fail:
+
+ HAVE_LINUX_INODE_OPERATIONS_RENAME_TAKES_FLAGS
+ HAVE_LINUX_SETATTR_PREPARE
+ IOP_CREATE_TAKES_BOOL
+ IOP_GETATTR_TAKES_PATH_STRUCT
+ IOP_MKDIR_TAKES_UMODE_T
+
+The new macro 'IOP_TAKES_USER_NAMESPACE' covers the cases where these
+macros where used.
+
+Reviewed-on: https://gerrit.openafs.org/14549
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+(cherry picked from commit 1bd68506be3243c5670aaf53798b2e4e715d4c8b)
+
+Change-Id: I8cd54042da4e0295f3cf8417c84138bb0458f881
+Reviewed-on: https://gerrit.openafs.org/14565
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
+---
+ src/afs/LINUX/osi_compat.h | 8 +++--
+ src/afs/LINUX/osi_vnodeops.c | 69 +++++++++++++++++++++++++++++++-----
+ src/cf/linux-kernel-sig.m4 | 16 ++++++++-
+ 3 files changed, 81 insertions(+), 12 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
+index 3ac4d798d..726b6559c 100644
+--- a/src/afs/LINUX/osi_compat.h
++++ b/src/afs/LINUX/osi_compat.h
+@@ -524,7 +524,9 @@ afs_inode_setattr(struct osi_file *afile, struct iattr *newattrs) {
+
+ int code = 0;
+ struct inode *inode = OSIFILE_INODE(afile);
+-#if !defined(HAVE_LINUX_INODE_SETATTR)
++#if defined(IOP_TAKES_USER_NAMESPACE)
++ code = inode->i_op->setattr(afs_ns, afile->filp->f_dentry, newattrs);
++#elif !defined(HAVE_LINUX_INODE_SETATTR)
+ code = inode->i_op->setattr(afile->filp->f_dentry, newattrs);
+ #elif defined(INODE_SETATTR_NOT_VOID)
+ if (inode->i_op && inode->i_op->setattr)
+@@ -751,7 +753,9 @@ afs_d_path(struct dentry *dp, struct vfsmount *mnt, char *buf, int buflen)
+ static inline int
+ afs_setattr_prepare(struct dentry *dp, struct iattr *newattrs)
+ {
+-#if defined(HAVE_LINUX_SETATTR_PREPARE)
++#if defined(IOP_TAKES_USER_NAMESPACE)
++ return setattr_prepare(afs_ns, dp, newattrs);
++#elif defined(HAVE_LINUX_SETATTR_PREPARE)
+ return setattr_prepare(dp, newattrs);
+ #else
+ return inode_change_ok(dp->d_inode, newattrs);
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 4d0f55c95..9d4a6e334 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -1118,8 +1118,13 @@ vattr2inode(struct inode *ip, struct vattr *vp)
+ * Linux version of setattr call. What to change is in the iattr struct.
+ * We need to set bits in both the Linux inode as well as the vcache.
+ */
++#if defined(IOP_TAKES_USER_NAMESPACE)
++static int
++afs_notify_change(struct user_namespace *mnt_userns, struct dentry *dp, struct iattr *iattrp)
++#else
+ static int
+ afs_notify_change(struct dentry *dp, struct iattr *iattrp)
++#endif
+ {
+ struct vattr *vattr = NULL;
+ cred_t *credp = crref();
+@@ -1147,7 +1152,18 @@ out:
+ return afs_convert_code(code);
+ }
+
+-#if defined(IOP_GETATTR_TAKES_PATH_STRUCT)
++#if defined(IOP_TAKES_USER_NAMESPACE)
++static int
++afs_linux_getattr(struct user_namespace *mnt_userns, const struct path *path, struct kstat *stat,
++ u32 request_mask, unsigned int sync_mode)
++{
++ int err = afs_linux_revalidate(path->dentry);
++ if (!err) {
++ generic_fillattr(afs_ns, path->dentry->d_inode, stat);
++ }
++ return err;
++}
++#elif defined(IOP_GETATTR_TAKES_PATH_STRUCT)
+ static int
+ afs_linux_getattr(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int sync_mode)
+ {
+@@ -1605,17 +1621,25 @@ struct dentry_operations afs_dentry_operations = {
+ *
+ * name is in kernel space at this point.
+ */
++
++#if defined(IOP_TAKES_USER_NAMESPACE)
++static int
++afs_linux_create(struct user_namespace *mnt_userns, struct inode *dip,
++ struct dentry *dp, umode_t mode, bool excl)
++#elif defined(IOP_CREATE_TAKES_BOOL)
+ static int
+-#if defined(IOP_CREATE_TAKES_BOOL)
+ afs_linux_create(struct inode *dip, struct dentry *dp, umode_t mode,
+ bool excl)
+ #elif defined(IOP_CREATE_TAKES_UMODE_T)
++static int
+ afs_linux_create(struct inode *dip, struct dentry *dp, umode_t mode,
+ struct nameidata *nd)
+ #elif defined(IOP_CREATE_TAKES_NAMEIDATA)
++static int
+ afs_linux_create(struct inode *dip, struct dentry *dp, int mode,
+ struct nameidata *nd)
+ #else
++static int
+ afs_linux_create(struct inode *dip, struct dentry *dp, int mode)
+ #endif
+ {
+@@ -1890,8 +1914,14 @@ afs_linux_unlink(struct inode *dip, struct dentry *dp)
+ }
+
+
++#if defined(IOP_TAKES_USER_NAMESPACE)
++static int
++afs_linux_symlink(struct user_namespace *mnt_userns, struct inode *dip,
++ struct dentry *dp, const char *target)
++#else
+ static int
+ afs_linux_symlink(struct inode *dip, struct dentry *dp, const char *target)
++#endif
+ {
+ int code;
+ cred_t *credp = crref();
+@@ -1919,10 +1949,15 @@ out:
+ return afs_convert_code(code);
+ }
+
++#if defined(IOP_TAKES_USER_NAMESPACE)
++static int
++afs_linux_mkdir(struct user_namespace *mnt_userns, struct inode *dip,
++ struct dentry *dp, umode_t mode)
++#elif defined(IOP_MKDIR_TAKES_UMODE_T)
+ static int
+-#if defined(IOP_MKDIR_TAKES_UMODE_T)
+ afs_linux_mkdir(struct inode *dip, struct dentry *dp, umode_t mode)
+ #else
++static int
+ afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode)
+ #endif
+ {
+@@ -1994,13 +2029,22 @@ afs_linux_rmdir(struct inode *dip, struct dentry *dp)
+ }
+
+
++#if defined(IOP_TAKES_USER_NAMESPACE)
++static int
++afs_linux_rename(struct user_namespace *mnt_userns,
++ struct inode *oldip, struct dentry *olddp,
++ struct inode *newip, struct dentry *newdp,
++ unsigned int flags)
++#elif defined(HAVE_LINUX_INODE_OPERATIONS_RENAME_TAKES_FLAGS)
++static int
++afs_linux_rename(struct inode *oldip, struct dentry *olddp,
++ struct inode *newip, struct dentry *newdp,
++ unsigned int flags)
++#else
+ static int
+ afs_linux_rename(struct inode *oldip, struct dentry *olddp,
+- struct inode *newip, struct dentry *newdp
+-#ifdef HAVE_LINUX_INODE_OPERATIONS_RENAME_TAKES_FLAGS
+- , unsigned int flags
++ struct inode *newip, struct dentry *newdp)
+ #endif
+- )
+ {
+ int code;
+ cred_t *credp = crref();
+@@ -2008,7 +2052,8 @@ afs_linux_rename(struct inode *oldip, struct dentry *olddp,
+ const char *newname = newdp->d_name.name;
+ struct dentry *rehash = NULL;
+
+-#ifdef HAVE_LINUX_INODE_OPERATIONS_RENAME_TAKES_FLAGS
++#if defined(HAVE_LINUX_INODE_OPERATIONS_RENAME_TAKES_FLAGS) || \
++ defined(IOP_TAKES_USER_NAMESPACE)
+ if (flags)
+ return -EINVAL; /* no support for new flags yet */
+ #endif
+@@ -3030,12 +3075,18 @@ done:
+ /* afs_linux_permission
+ * Check access rights - returns error if can't check or permission denied.
+ */
++
++#if defined(IOP_TAKES_USER_NAMESPACE)
++static int
++afs_linux_permission(struct user_namespace *mnt_userns, struct inode *ip, int mode)
++#elif defined(IOP_PERMISSION_TAKES_FLAGS)
+ static int
+-#if defined(IOP_PERMISSION_TAKES_FLAGS)
+ afs_linux_permission(struct inode *ip, int mode, unsigned int flags)
+ #elif defined(IOP_PERMISSION_TAKES_NAMEIDATA)
++static int
+ afs_linux_permission(struct inode *ip, int mode, struct nameidata *nd)
+ #else
++static int
+ afs_linux_permission(struct inode *ip, int mode)
+ #endif
+ {
+diff --git a/src/cf/linux-kernel-sig.m4 b/src/cf/linux-kernel-sig.m4
+index 3d3aff909..e0cc9a2f3 100644
+--- a/src/cf/linux-kernel-sig.m4
++++ b/src/cf/linux-kernel-sig.m4
+@@ -14,4 +14,18 @@ AC_CHECK_LINUX_OPERATION([inode_operations], [rename], [takes_flags],
+ [struct inode *oinode, struct dentry *odentry,
+ struct inode *ninode, struct dentry *ndentry,
+ unsigned int flags])
+-])
++dnl Linux 5.12 added the user_namespace parameter to the several
++dnl inode operations functions.
++dnl Perform a generic test using the inode_op create to test for this change.
++AC_CHECK_LINUX_OPERATION([inode_operations], [create], [user_namespace],
++ [#include <linux/fs.h>],
++ [int],
++ [struct user_namespace *mnt_userns,
++ struct inode *inode, struct dentry *dentry,
++ umode_t umode, bool flag])
++dnl if HAVE_LINUX_INODE_OPERATIONS_CREATE_USER_NAMESPACE, create a more generic
++dnl define.
++AS_IF([test AS_VAR_GET([ac_cv_linux_operation_inode_operations_create_user_namespace]) = yes],
++ [AC_DEFINE([IOP_TAKES_USER_NAMESPACE], 1,
++ [define if inodeops require struct user_namespace])])
++])
+\ No newline at end of file
+--
+2.31.1
+
diff --git a/PKGBUILD b/PKGBUILD
index 9cabea004307..ca8b935a91af 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,7 +7,7 @@
pkgname=openafs-modules-dkms
_srcname=openafs
pkgver=1.8.7
-pkgrel=2
+pkgrel=3
pkgdesc="Kernel module for OpenAFS (dkms)"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.openafs.org"
@@ -25,17 +25,23 @@ source=("http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.b
0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch
0006-LINUX-Fix-includes-for-fatal_signal_pending-test.patch
0007-Linux-Refactor-test-for-32bit-compat.patch
- 0008-Linux-5.11-Test-32bit-compat-with-in_compat_syscall.patch)
+ 0008-Linux-5.11-Test-32bit-compat-with-in_compat_syscall.patch
+ 0009-LINUX-Introduce-afs_d_path.patch
+ 0010-Linux-Create-wrapper-for-setattr_prepare.patch
+ 0011-Linux-5.12-Add-user_namespace-param-to-inode-ops.patch)
sha256sums=('53543a561fce67714fec9f2a6bf408c5cc1d061c7dc9d1459458275e8ccbfa79'
'5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0'
- '89d423281ae4664467ff583d664cd014362f0f829f2bb1ef76809593626b55e0'
- 'cceb2501cca12956644718c64db1c8c0e8d460afbbde302045427f0610b60a92'
- '729f14132a917c2397f4dc713d31c74c0a278c7359c5dd4edc3758fb08e534c4'
- '73b69cea6eef193457091090fe2c6ae090040537395618dcb47c770196bc14ef'
- 'aef54d871c376648ef712e9cc224aa65ef012762a28778d53d509a72f99d174e'
- '38eaec2c4e08d45b4aa130ec581ed1e265950553432d8dd878f99decc54416de'
- 'c62380c6284f7da43234c7c2bea8503851cd455e0c06d688bbafb1d77cdbd476'
- 'ebb0c7ddd0fde966e35c277c7474abc39772a1bbaa601e7a678c95aad31bfb48')
+ '909ebe2f2f82187ec5c8bd19a385e310521dceedb0b0d5ce8413809a37fe5654'
+ '2439b2f663feed02c526f4e34b2cdc2a1d5ad35f7223ade87508c1cf4359ee9c'
+ 'e605d4e7154f9ccf4dec24fec27abe4e2947713f35dae6aa8698e5f8722609a7'
+ '15b53b4ab0578eaa31f849670990e15949e67be8b330d7581825a5e8408953ed'
+ 'ba8c81c035303cbcf204744516a83b66adac94384aaa59ea2ea1a619a41aa7c0'
+ 'd078882d94adf881bac2e7955689931abe7ac443db86d85e0b60c72d8b27738e'
+ '19ca49013e32824002e355a85df6e25028283a0b06a6409cc7d5cd9800fea488'
+ '52d40f8a3b032a9fa0ae57bc15d3611bc652ff6e417a488eac4223cef0db9142'
+ '457474e625565c28daa6d642b2416b4398b2b9fec3a8b90c048fc0460412a0ce'
+ '76d73a55d3e8da63c9ead2cecdec1efbaeb78739bb5abf635a64380eeba35158'
+ '8bc24efe33f06228134dd27e5c9a6832abb436e2fbe3fab09b529fed4a5b406c')
prepare() {
cd "${srcdir}/${_srcname}-${pkgver}"
@@ -56,6 +62,11 @@ prepare() {
patch -p1 < "${srcdir}"/0007-Linux-Refactor-test-for-32bit-compat.patch
patch -p1 < "${srcdir}"/0008-Linux-5.11-Test-32bit-compat-with-in_compat_syscall.patch
+ # Compatibility with Linux 5.12
+ patch -p1 < "${srcdir}"/0009-LINUX-Introduce-afs_d_path.patch
+ patch -p1 < "${srcdir}"/0010-Linux-Create-wrapper-for-setattr_prepare.patch
+ patch -p1 < "${srcdir}"/0011-Linux-5.12-Add-user_namespace-param-to-inode-ops.patch
+
# Only needed when changes to configure were made
./regen.sh -q
}