summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lass2016-05-06 22:44:09 +0200
committerMichael Lass2016-05-06 22:44:09 +0200
commit588eb4a986c0de9d366b7e40cdd6afff14ff0037 (patch)
tree13c237af89e9a70d9d5fead4ea5c611a813e079a
parent6c9b47688853b428fa49668ebe2160058a281cc2 (diff)
downloadaur-588eb4a986c0de9d366b7e40cdd6afff14ff0037.tar.gz
Update to 1.6.18 and add patches for Linux 4.5
-rw-r--r--.SRCINFO26
-rw-r--r--0001-Linux-3.13-Check-return-value-from-bdi_init.patch66
-rw-r--r--0001-Linux-4.4-key_payload-has-no-member-value.patch84
-rw-r--r--0002-Linux-4.4-Use-locks_lock_file_wait.patch56
-rw-r--r--0002-Linux-4.5-no-highmem-in-symlink-ops.patch45
-rw-r--r--0003-Linux-4.4-Do-not-use-splice.patch114
-rw-r--r--0003-Linux-4.5-get_link-instead-of-follow_link-put_link.patch80
-rw-r--r--0004-Linux-lock-the-parent-dentry-for-lookup_one_len.patch35
-rw-r--r--0005-Linux-4.5-don-t-access-i_mutex-directly.patch88
-rw-r--r--PKGBUILD30
10 files changed, 347 insertions, 277 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d868532e8ad8..5ea80f9a1e1a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
# Generated by mksrcinfo v8
-# Mon Mar 21 22:37:54 UTC 2016
+# Fri May 6 19:10:53 UTC 2016
pkgbase = openafs-modules-dkms
pkgdesc = Kernel module for OpenAFS (dkms)
- pkgver = 1.6.17
+ pkgver = 1.6.18
pkgrel = 1
url = http://www.openafs.org
arch = i686
@@ -11,21 +11,25 @@ pkgbase = openafs-modules-dkms
license = custom:"IBM Public License Version 1.0"
depends = dkms
depends = openafs
- provides = openafs-modules=1.6.17
+ provides = openafs-modules=1.6.18
conflicts = openafs-features-libafs
conflicts = openafs-modules
conflicts = openafs<1.6.6-2
options = !emptydirs
- source = http://openafs.org/dl/1.6.17/openafs-1.6.17-src.tar.bz2
+ source = http://openafs.org/dl/1.6.18/openafs-1.6.18-src.tar.bz2
source = dkms.conf
- source = 0001-Linux-4.4-key_payload-has-no-member-value.patch
- source = 0002-Linux-4.4-Use-locks_lock_file_wait.patch
- source = 0003-Linux-4.4-Do-not-use-splice.patch
- sha256sums = 96413a2dbffdc9170cc5dde6aa5ad0ae2383c6106994285ed8f186928813a398
+ source = 0001-Linux-3.13-Check-return-value-from-bdi_init.patch
+ source = 0002-Linux-4.5-no-highmem-in-symlink-ops.patch
+ source = 0003-Linux-4.5-get_link-instead-of-follow_link-put_link.patch
+ source = 0004-Linux-lock-the-parent-dentry-for-lookup_one_len.patch
+ source = 0005-Linux-4.5-don-t-access-i_mutex-directly.patch
+ sha256sums = b3c35e7be6b6c86b91e7c699fd015f53c87bc19d1ae8ec3ec9cda6b97327d3b6
sha256sums = ea7d1e6dfb5006016e25738be722c8793765f52ad55c0bbf588dd7fdf2bdd2bf
- sha256sums = f498b60b99f75a2cfbe01cc91c5de0585c225231b4850816c8b080edd7402a98
- sha256sums = ff962b1bcfeedaed0f74570e8d248b4e42a3391654bf49b4bb25e19d80b6c4ac
- sha256sums = 2c2c14f2f1f88eb43a7160f3112cd63e4ea74884322b76b71308b88b32caafdb
+ sha256sums = bec998ce038349025fe030c692f7f0fe46bbe8922433cf6be6298aac536f34cf
+ sha256sums = d18b1278c097825801fa1c721cae861f985d9da5460475b74cefe1eb789a1f92
+ sha256sums = 6336dde35c68c74ae9427b312f170481616d8d347ec4ddfa2966a683797361b0
+ sha256sums = fa485ab7a54499eb87b91ec8ea3f33e0894e9e4dc1d0bb825d5ac84a2f3cbc93
+ sha256sums = e3f369f000df13a4d207c1533d63ffa0b139c3d374294f6d1fbc77f5e5b9b4df
pkgname = openafs-modules-dkms
diff --git a/0001-Linux-3.13-Check-return-value-from-bdi_init.patch b/0001-Linux-3.13-Check-return-value-from-bdi_init.patch
new file mode 100644
index 000000000000..b0fb3cf90a39
--- /dev/null
+++ b/0001-Linux-3.13-Check-return-value-from-bdi_init.patch
@@ -0,0 +1,66 @@
+From 87377a9547443ae41aa6e393129389a765573aa3 Mon Sep 17 00:00:00 2001
+From: Marc Dionne <marc.dionne@your-file-system.com>
+Date: Tue, 3 Dec 2013 14:10:00 -0500
+Subject: [PATCH 1/5] Linux 3.13: Check return value from bdi_init
+
+The use of the bdi_init function now gets a warning because the
+return value is unused and the function is now defined with
+the warn_unused_result attribute.
+
+Assign and check the return value.
+
+Reviewed-on: http://gerrit.openafs.org/10530
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
+(cherry picked from commit ccc5d3f7adceda4d8cf41f04fe02d5cfe376befd)
+
+Change-Id: I2ccd9bbdce396a003030e3e09f9f6d75a1c4fa7c
+---
+ src/afs/LINUX/osi_vfsops.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c
+index 3936d4d..c222668 100644
+--- a/src/afs/LINUX/osi_vfsops.c
++++ b/src/afs/LINUX/osi_vfsops.c
+@@ -87,6 +87,9 @@ int
+ afs_fill_super(struct super_block *sb, void *data, int silent)
+ {
+ int code = 0;
++#if defined(HAVE_LINUX_BDI_INIT)
++ int bdi_init_done = 0;
++#endif
+
+ AFS_GLOCK();
+ if (afs_was_mounted) {
+@@ -115,7 +118,10 @@ afs_fill_super(struct super_block *sb, void *data, int silent)
+ afs_backing_dev_info = kmalloc(sizeof(struct backing_dev_info), GFP_NOFS);
+ memset(afs_backing_dev_info, 0, sizeof(struct backing_dev_info));
+ #if defined(HAVE_LINUX_BDI_INIT)
+- bdi_init(afs_backing_dev_info);
++ code = bdi_init(afs_backing_dev_info);
++ if (code)
++ goto out;
++ bdi_init_done = 1;
+ #endif
+ #if defined(STRUCT_BACKING_DEV_INFO_HAS_NAME)
+ afs_backing_dev_info->name = "openafs";
+@@ -144,11 +150,13 @@ afs_fill_super(struct super_block *sb, void *data, int silent)
+ #endif
+ #endif
+ code = afs_root(sb);
++out:
+ if (code) {
+ afs_globalVFS = NULL;
+ afs_FlushAllVCaches();
+ #if defined(HAVE_LINUX_BDI_INIT)
+- bdi_destroy(afs_backing_dev_info);
++ if (bdi_init_done)
++ bdi_destroy(afs_backing_dev_info);
+ #endif
+ kfree(afs_backing_dev_info);
+ module_put(THIS_MODULE);
+--
+2.8.2
+
diff --git a/0001-Linux-4.4-key_payload-has-no-member-value.patch b/0001-Linux-4.4-key_payload-has-no-member-value.patch
deleted file mode 100644
index 68f429af7391..000000000000
--- a/0001-Linux-4.4-key_payload-has-no-member-value.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 2d524981c32ac8f502fa344aac1a4952c64078f1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Michael=20La=C3=9F?= <lass@mail.uni-paderborn.de>
-Date: Mon, 18 Jan 2016 18:29:00 +0100
-Subject: [PATCH 1/3] Linux 4.4: key_payload has no member 'value'
-
-In Linux 4.4 (146aa8b1453bd8f1ff2304ffb71b4ee0eb9acdcc) type-specific and
-payload data have been merged. The payload is now accessed directly and has
-no 'value' member anymore.
-
-FIXES 132677
-
-Reviewed-on: https://gerrit.openafs.org/12169
-Tested-by: BuildBot <buildbot@rampaginggeek.com>
-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 5067ee3ae11932a3f1c972c8f88b20afbd9e1d88)
-
-Change-Id: I5a3e89b2676b463935e9a77042cbcd8ab812dc68
----
- acinclude.m4 | 1 +
- src/afs/LINUX/osi_groups.c | 16 +++++++++++++++-
- 2 files changed, 16 insertions(+), 1 deletion(-)
-
-diff --git a/acinclude.m4 b/acinclude.m4
-index b1444a1..a7a7cb6 100644
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -882,6 +882,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
- AC_CHECK_LINUX_STRUCT([file_operations], [sendfile], [fs.h])
- AC_CHECK_LINUX_STRUCT([file_system_type], [mount], [fs.h])
- AC_CHECK_LINUX_STRUCT([inode_operations], [truncate], [fs.h])
-+ AC_CHECK_LINUX_STRUCT([key], [payload.value], [key.h])
- AC_CHECK_LINUX_STRUCT([key_type], [instantiate_prep], [key-type.h])
- AC_CHECK_LINUX_STRUCT([key_type], [match_preparse], [key-type.h])
- AC_CHECK_LINUX_STRUCT([key_type], [preparse], [key-type.h])
-diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c
-index 3b068e5..a83bcb9 100644
---- a/src/afs/LINUX/osi_groups.c
-+++ b/src/afs/LINUX/osi_groups.c
-@@ -489,7 +489,11 @@ static int afs_pag_instantiate(struct key *key, const void *data, size_t datalen
- if (*userpag != pag)
- goto error;
-
-+#if defined(STRUCT_KEY_HAS_PAYLOAD_VALUE)
- key->payload.value = (unsigned long) *userpag;
-+#else
-+ memcpy(&key->payload, userpag, sizeof(afs_uint32));
-+#endif
- key->datalen = sizeof(afs_uint32);
- code = 0;
-
-@@ -513,9 +517,15 @@ static int afs_pag_match(const struct key *key, const void *description)
-
- static void afs_pag_destroy(struct key *key)
- {
-- afs_uint32 pag = key->payload.value;
-+ afs_uint32 pag;
- int locked = ISAFS_GLOCK();
-
-+#if defined(STRUCT_KEY_HAS_PAYLOAD_VALUE)
-+ pag = key->payload.value;
-+#else
-+ memcpy(&pag, &key->payload, sizeof(afs_uint32));
-+#endif
-+
- if (!locked)
- AFS_GLOCK();
-
-@@ -609,7 +619,11 @@ osi_get_keyring_pag(afs_ucred_t *cred)
-
- if (!IS_ERR(key)) {
- if (key_validate(key) == 0 && uid_eq(key->uid, GLOBAL_ROOT_UID)) { /* also verify in the session keyring? */
-+#if defined(STRUCT_KEY_HAS_PAYLOAD_VALUE)
- keyring_pag = key->payload.value;
-+#else
-+ memcpy(&keyring_pag, &key->payload, sizeof(afs_int32));
-+#endif
- /* Only set PAG in groups if needed,
- * and the creds are from the current process */
- if (afs_linux_cred_is_current(cred) &&
---
-2.7.4
-
diff --git a/0002-Linux-4.4-Use-locks_lock_file_wait.patch b/0002-Linux-4.4-Use-locks_lock_file_wait.patch
deleted file mode 100644
index 0f0bc4f1efba..000000000000
--- a/0002-Linux-4.4-Use-locks_lock_file_wait.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From b7b656c5240eb4b62a5905370759daa4f1b03521 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Michael=20La=C3=9F?= <lass@mail.uni-paderborn.de>
-Date: Mon, 18 Jan 2016 19:58:00 +0100
-Subject: [PATCH 2/3] Linux 4.4: Use locks_lock_file_wait
-
-The locks API was changed in Linux 4.4, introducing locks_lock_file_wait
-(e55c34a66f87e78fb1fc6b623b78c5ad74b475af) and removing
-flock_lock_file_wait (616fb38fa7a9599293e05ae1fa9acfaf73922434).
-
-locks_lock_file_wait can be used as a drop-in replacement so define
-flock_lock_file_wait as an alias for it.
-
-Reviewed-on: https://gerrit.openafs.org/12170
-Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
-Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
-Tested-by: BuildBot <buildbot@rampaginggeek.com>
-(cherry picked from commit 58d82226a555d3781a5cb45e5cc177727628ebd8)
-
-Change-Id: Icceae3906c1a612fb9104b860e519bb7f94d25d3
----
- acinclude.m4 | 3 +++
- src/afs/LINUX/osi_compat.h | 4 ++++
- 2 files changed, 7 insertions(+)
-
-diff --git a/acinclude.m4 b/acinclude.m4
-index a7a7cb6..afad50b 100644
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -976,6 +976,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
- AC_CHECK_LINUX_FUNC([kernel_setsockopt],
- [#include <linux/net.h>],
- [kernel_setsockopt(NULL, 0, 0, NULL, 0);])
-+ AC_CHECK_LINUX_FUNC([locks_lock_file_wait],
-+ [#include <linux/fs.h>],
-+ [locks_lock_file_wait(NULL, NULL);])
- AC_CHECK_LINUX_FUNC([page_follow_link],
- [#include <linux/fs.h>],
- [page_follow_link(0,0);])
-diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
-index 47450e6..4d484c1 100644
---- a/src/afs/LINUX/osi_compat.h
-+++ b/src/afs/LINUX/osi_compat.h
-@@ -47,6 +47,10 @@ typedef struct path afs_linux_path_t;
- # endif
- #endif
-
-+#if defined(HAVE_LINUX_LOCKS_LOCK_FILE_WAIT)
-+# define flock_lock_file_wait locks_lock_file_wait
-+#endif
-+
- #if !defined(HAVE_LINUX_DO_SYNC_READ) && !defined(STRUCT_FILE_OPERATIONS_HAS_READ_ITER)
- static inline int
- do_sync_read(struct file *fp, char *buf, size_t count, loff_t *offp) {
---
-2.7.4
-
diff --git a/0002-Linux-4.5-no-highmem-in-symlink-ops.patch b/0002-Linux-4.5-no-highmem-in-symlink-ops.patch
new file mode 100644
index 000000000000..7e42d62ef064
--- /dev/null
+++ b/0002-Linux-4.5-no-highmem-in-symlink-ops.patch
@@ -0,0 +1,45 @@
+From fc08da3fd6a93a6de215fc6cb9f3a858dea3bfc0 Mon Sep 17 00:00:00 2001
+From: Benjamin Kaduk <kaduk@mit.edu>
+Date: Sun, 1 May 2016 19:04:45 -0400
+Subject: [PATCH 2/5] Linux 4.5: no highmem in symlink ops
+
+Symlink bodies in the pagecache should not be in highmem, as
+upstream converted in commit 21fc61c73.
+
+Change-Id: I1e4c3c51308df096cdfa4d5e7b16279e275e7f41
+---
+ acinclude.m4 | 3 +++
+ src/afs/LINUX/osi_vnodeops.c | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 4f8e2c0..c8a7ceb 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -1034,6 +1034,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ [#include <linux/kernel.h>
+ #include <linux/kthread.h>],
+ [kthread_run(NULL, NULL, "test");])
++ AC_CHECK_LINUX_FUNC([inode_nohighmem],
++ [#include <linux/fs.h>],
++ [inode_nohighmem(NULL);])
+
+ dnl Consequences - things which get set as a result of the
+ dnl above tests
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 1b99c94..2f753dd 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -3143,6 +3143,9 @@ afs_fill_inode(struct inode *ip, struct vattr *vattr)
+
+ } else if (S_ISLNK(ip->i_mode)) {
+ ip->i_op = &afs_symlink_iops;
++#if defined(HAVE_LINUX_INODE_NOHIGHMEM)
++ inode_nohighmem(ip);
++#endif
+ #if defined(USABLE_KERNEL_PAGE_SYMLINK_CACHE)
+ ip->i_data.a_ops = &afs_symlink_aops;
+ ip->i_mapping = &ip->i_data;
+--
+2.8.2
+
diff --git a/0003-Linux-4.4-Do-not-use-splice.patch b/0003-Linux-4.4-Do-not-use-splice.patch
deleted file mode 100644
index 4eef0bcc2a0a..000000000000
--- a/0003-Linux-4.4-Do-not-use-splice.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-From c664b14959c366ff5fb36ce9b7934df61f44828d Mon Sep 17 00:00:00 2001
-From: Stephan Wiesand <stephan.wiesand@desy.de>
-Date: Tue, 8 Mar 2016 14:15:17 +0100
-Subject: [PATCH 3/3] Linux 4.4: Do not use splice()
-
-splice() may return -ERESTARTSYS if there are pending signals, and
-it's not even clear how this should be dealt with. This potential
-problem has been present for a long time, but as of Linux 4.4
-(commit c725bfce7968009756ed2836a8cd7ba4dc163011) seems much more
-likely to happen.
-
-Until resources are available to fix the code to handle such errors,
-avoid the riskier uses of splice().
-
-If there is a default implementation of file_splice_{write,read},
-use that; on somewhat older kernels where it is not available,
-use the generic version instead.
-
-[kaduk@mit.edu: add test for default_file_splice_write]
-
-Reviewed-on: https://gerrit.openafs.org/12217
-Reviewed-by: Chas Williams <3chas3@gmail.com>
-Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
-Tested-by: BuildBot <buildbot@rampaginggeek.com>
-(cherry picked from commit ae5f411c3b374367ab8ae69488f78f8e0484ce48)
-
-Change-Id: I40dd0d60caece6379a62674defb8d46a2bfadad6
----
- acinclude.m4 | 3 +++
- src/afs/LINUX/osi_fetchstore.c | 6 ++++--
- src/afs/LINUX/osi_vnodeops.c | 2 +-
- src/afs/afs_fetchstore.c | 2 +-
- 4 files changed, 9 insertions(+), 4 deletions(-)
-
-diff --git a/acinclude.m4 b/acinclude.m4
-index afad50b..09ae278 100644
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -1010,6 +1010,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
- AC_CHECK_LINUX_FUNC([splice_direct_to_actor],
- [#include <linux/splice.h>],
- [splice_direct_to_actor(NULL,NULL,NULL);])
-+ AC_CHECK_LINUX_FUNC([default_file_splice_read],
-+ [#include <linux/fs.h>],
-+ [default_file_splice_read(NULL,NULL,NULL, 0, 0);])
- AC_CHECK_LINUX_FUNC([svc_addr_in],
- [#include <linux/sunrpc/svc.h>],
- [svc_addr_in(NULL);])
-diff --git a/src/afs/LINUX/osi_fetchstore.c b/src/afs/LINUX/osi_fetchstore.c
-index 4089bbb..997c1aa 100644
---- a/src/afs/LINUX/osi_fetchstore.c
-+++ b/src/afs/LINUX/osi_fetchstore.c
-@@ -38,7 +38,7 @@
- #include "afs/param.h"
-
- #include <linux/fs.h>
--#if defined(HAVE_LINUX_SPLICE_DIRECT_TO_ACTOR)
-+#if 0 && defined(HAVE_LINUX_SPLICE_DIRECT_TO_ACTOR)
- # include <linux/splice.h>
- #else
- # include <linux/pipe_fs_i.h>
-@@ -47,7 +47,7 @@
- #include "afs/sysincludes.h"
- #include "afsincludes.h"
-
--#if defined(HAVE_LINUX_SPLICE_DIRECT_TO_ACTOR)
-+#if 0 && defined(HAVE_LINUX_SPLICE_DIRECT_TO_ACTOR)
- static int
- afs_linux_splice_actor(struct pipe_inode_info *pipe,
- struct pipe_buffer *buf,
-@@ -151,6 +151,7 @@ afs_linux_read_actor(read_descriptor_t *desc, struct page *page,
- return size;
- }
-
-+#if 0
- afs_int32
- afs_linux_storeproc(struct storeOps *ops, void *rock, struct dcache *tdc,
- int *shouldwake, afs_size_t *bytesXferred)
-@@ -184,5 +185,6 @@ afs_linux_storeproc(struct storeOps *ops, void *rock, struct dcache *tdc,
-
- return code;
- }
-+#endif
-
- #endif
-diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
-index ae0513c..2a83fc0 100644
---- a/src/afs/LINUX/osi_vnodeops.c
-+++ b/src/afs/LINUX/osi_vnodeops.c
-@@ -834,7 +834,7 @@ struct file_operations afs_file_fops = {
- #if defined(STRUCT_FILE_OPERATIONS_HAS_SENDFILE)
- .sendfile = generic_file_sendfile,
- #endif
--#if defined(STRUCT_FILE_OPERATIONS_HAS_SPLICE)
-+#if defined(STRUCT_FILE_OPERATIONS_HAS_SPLICE) && !defined(HAVE_LINUX_DEFAULT_FILE_SPLICE_READ)
- # if defined(HAVE_LINUX_ITER_FILE_SPLICE_WRITE)
- .splice_write = iter_file_splice_write,
- # else
-diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c
-index 38b064c..98544fe 100644
---- a/src/afs/afs_fetchstore.c
-+++ b/src/afs/afs_fetchstore.c
-@@ -329,7 +329,7 @@ struct storeOps rxfs_storeUfsOps = {
- .padd = rxfs_storePadd,
- .close = rxfs_storeClose,
- .destroy = rxfs_storeDestroy,
--#ifdef AFS_LINUX26_ENV
-+#if 0 && defined(AFS_LINUX26_ENV)
- .storeproc = afs_linux_storeproc
- #else
- .storeproc = afs_GenericStoreProc
---
-2.7.4
-
diff --git a/0003-Linux-4.5-get_link-instead-of-follow_link-put_link.patch b/0003-Linux-4.5-get_link-instead-of-follow_link-put_link.patch
new file mode 100644
index 000000000000..15be91bebe8a
--- /dev/null
+++ b/0003-Linux-4.5-get_link-instead-of-follow_link-put_link.patch
@@ -0,0 +1,80 @@
+From 97591edd99583f460d61cece34f9e2173ea637fb Mon Sep 17 00:00:00 2001
+From: Chaskiel Grundman <cg2v@andrew.cmu.edu>
+Date: Thu, 5 May 2016 12:35:08 -0400
+Subject: [PATCH 3/5] Linux 4.5: get_link instead of follow_link+put_link
+
+In linux commit 6b255391, the follow_link inode operation was
+replaced by the get_link operation, which is basically the same
+but takes the inode and dentry separately, allowing for the
+possibility of staying in RCU mode.
+
+For now, only support this if page_get_link is available and we are
+using the USABLE_KERNEL_PAGE_SYMLINK_CACHE
+
+The previous test for USABLE_KERNEL_PAGE_SYMLINK_CACHE used a bogus,
+undefined configure variable (ac_cv_linux_kernel_page_follow_link).
+Remove it, as it was not needed
+
+Change-Id: I2d7851d31dd4b1b944b16fad611addb804930eca
+---
+ acinclude.m4 | 10 +++++++++-
+ src/afs/LINUX/osi_vnodeops.c | 4 +++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index c8a7ceb..aca1316 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -890,6 +890,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ AC_CHECK_LINUX_STRUCT([file_operations], [sendfile], [fs.h])
+ AC_CHECK_LINUX_STRUCT([file_system_type], [mount], [fs.h])
+ AC_CHECK_LINUX_STRUCT([inode_operations], [truncate], [fs.h])
++ AC_CHECK_LINUX_STRUCT([inode_operations], [get_link], [fs.h])
+ AC_CHECK_LINUX_STRUCT([key], [payload.value], [key.h])
+ AC_CHECK_LINUX_STRUCT([key_type], [instantiate_prep], [key-type.h])
+ AC_CHECK_LINUX_STRUCT([key_type], [match_preparse], [key-type.h])
+@@ -990,6 +991,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ AC_CHECK_LINUX_FUNC([page_follow_link],
+ [#include <linux/fs.h>],
+ [page_follow_link(0,0);])
++ AC_CHECK_LINUX_FUNC([page_get_link],
++ [#include <linux/fs.h>],
++ [page_get_link(0,0,0);])
+ AC_CHECK_LINUX_FUNC([page_offset],
+ [#include <linux/pagemap.h>],
+ [page_offset(NULL);])
+@@ -1168,11 +1172,15 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ if test -f "$LINUX_KERNEL_PATH/include/linux/mm_inline.h"; then
+ AC_DEFINE(HAVE_MM_INLINE_H, 1, [define if you have mm_inline.h header file])
+ fi
+- if test "x$ac_cv_linux_kernel_page_follow_link" = "xyes" -o "x$ac_cv_linux_func_i_put_link_takes_cookie" = "xyes"; then
++ if test "x$ac_cv_linux_func_page_get_link" = "xyes" -o "x$ac_cv_linux_func_i_put_link_takes_cookie" = "xyes"; then
+ AC_DEFINE(USABLE_KERNEL_PAGE_SYMLINK_CACHE, 1, [define if your kernel has a usable symlink cache API])
+ else
+ AC_MSG_WARN([your kernel does not have a usable symlink cache API])
+ fi
++ if test "x$ac_cv_linux_func_page_get_link" != "xyes" -a "x$ac_cv_linux_struct_inode_operations_has_get_link" = "xyes"; then
++ AC_MSG_ERROR([Your kernel does not use follow_link - not supported without symlink cache API])
++ exit 1
++ fi
+ :
+ fi
+ if test "x$enable_linux_d_splice_alias_extra_iput" = xyes; then
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 2f753dd..00b41ef 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -3108,7 +3108,9 @@ static struct address_space_operations afs_symlink_aops = {
+ static struct inode_operations afs_symlink_iops = {
+ #if defined(USABLE_KERNEL_PAGE_SYMLINK_CACHE)
+ .readlink = page_readlink,
+-# if defined(HAVE_LINUX_PAGE_FOLLOW_LINK)
++# if defined(HAVE_LINUX_PAGE_GET_LINK)
++ .get_link = page_get_link,
++# elif defined(HAVE_LINUX_PAGE_FOLLOW_LINK)
+ .follow_link = page_follow_link,
+ # else
+ .follow_link = page_follow_link_light,
+--
+2.8.2
+
diff --git a/0004-Linux-lock-the-parent-dentry-for-lookup_one_len.patch b/0004-Linux-lock-the-parent-dentry-for-lookup_one_len.patch
new file mode 100644
index 000000000000..52856dcbcc56
--- /dev/null
+++ b/0004-Linux-lock-the-parent-dentry-for-lookup_one_len.patch
@@ -0,0 +1,35 @@
+From a42d68d51dc8c864cf5fde02a8f0277e82ca8696 Mon Sep 17 00:00:00 2001
+From: Benjamin Kaduk <kaduk@mit.edu>
+Date: Sun, 1 May 2016 19:39:55 -0400
+Subject: [PATCH 4/5] Linux: lock the parent dentry for lookup_one_len()
+
+During review of the changes in Linux 4.5, it was noted that
+callers of lookup_one_len() are obligated to hold the i_mutex
+on the parent directory, though we do not currently do so.
+Take the lock around the call as needed.
+
+The only call to lookup_one_len() occurs in afs_linux_sillyrename(),
+so may workloads may not encounter this codepath.
+
+Change-Id: I4d566c9a704173973c062c3d38f1d481f76c42da
+---
+ src/afs/LINUX/osi_vnodeops.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 00b41ef..532c9e9 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -1654,7 +1654,9 @@ afs_linux_sillyrename(struct inode *dir, struct dentry *dentry,
+ __name = afs_newname();
+ AFS_GUNLOCK();
+
++ afs_linux_lock_inode(dentry->d_parent->d_inode);
+ __dp = lookup_one_len(__name, dentry->d_parent, strlen(__name));
++ afs_linux_unlock_inode(dentry->d_parent->d_inode);
+
+ if (IS_ERR(__dp)) {
+ osi_FreeSmallSpace(__name);
+--
+2.8.2
+
diff --git a/0005-Linux-4.5-don-t-access-i_mutex-directly.patch b/0005-Linux-4.5-don-t-access-i_mutex-directly.patch
new file mode 100644
index 000000000000..db2a7dafb4a7
--- /dev/null
+++ b/0005-Linux-4.5-don-t-access-i_mutex-directly.patch
@@ -0,0 +1,88 @@
+From 68494a4bfe01cc70c7c3efb0640e46ce62fcf8f9 Mon Sep 17 00:00:00 2001
+From: Benjamin Kaduk <kaduk@mit.edu>
+Date: Sun, 1 May 2016 19:48:40 -0400
+Subject: [PATCH 5/5] Linux 4.5: don't access i_mutex directly
+
+Linux commit 5955102c, in preparation for future work, introduced
+wrapper functions to lock/unlock inode mutexes. This is to
+prepare for converting it to a read-write semaphore, so that
+lookup can be done with only the shared lock held.
+
+Adopt the afs_linux_*lock_inode() functions accordingly, and
+convert afs_linux_fsync() to using those wrappers, since the
+FOP_FSYNC_TAKES_RANGE case appears to be the current case.
+
+Amusingly, afs_linux_*lock_inode() already have a branch to
+handle the case when inode serialization is protected by a
+semaphore; it seems that this is going to come full-circle.
+
+Change-Id: Ia5a194acc559de21808655ef066151a0a3826364
+---
+ acinclude.m4 | 3 +++
+ src/afs/LINUX/osi_compat.h | 8 ++++++--
+ src/afs/LINUX/osi_vnodeops.c | 4 ++--
+ 3 files changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index aca1316..aa682ea 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -1041,6 +1041,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ AC_CHECK_LINUX_FUNC([inode_nohighmem],
+ [#include <linux/fs.h>],
+ [inode_nohighmem(NULL);])
++ AC_CHECK_LINUX_FUNC([inode_lock],
++ [#include <linux/fs.h>],
++ [inode_lock(NULL);])
+
+ dnl Consequences - things which get set as a result of the
+ dnl above tests
+diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
+index 4d484c1..5268e7e 100644
+--- a/src/afs/LINUX/osi_compat.h
++++ b/src/afs/LINUX/osi_compat.h
+@@ -427,7 +427,9 @@ afs_init_sb_export_ops(struct super_block *sb) {
+
+ static inline void
+ afs_linux_lock_inode(struct inode *ip) {
+-#ifdef STRUCT_INODE_HAS_I_MUTEX
++#if defined(HAVE_LINUX_INODE_LOCK)
++ inode_lock(ip);
++#elif defined(STRUCT_INODE_HAS_I_MUTEX)
+ mutex_lock(&ip->i_mutex);
+ #else
+ down(&ip->i_sem);
+@@ -436,7 +438,9 @@ afs_linux_lock_inode(struct inode *ip) {
+
+ static inline void
+ afs_linux_unlock_inode(struct inode *ip) {
+-#ifdef STRUCT_INODE_HAS_I_MUTEX
++#if defined(HAVE_LINUX_INODE_LOCK)
++ inode_unlock(ip);
++#elif defined(STRUCT_INODE_HAS_I_MUTEX)
+ mutex_unlock(&ip->i_mutex);
+ #else
+ up(&ip->i_sem);
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 532c9e9..dca4413 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -571,13 +571,13 @@ afs_linux_fsync(struct file *fp, int datasync)
+ cred_t *credp = crref();
+
+ #if defined(FOP_FSYNC_TAKES_RANGE)
+- mutex_lock(&ip->i_mutex);
++ afs_linux_lock_inode(ip);
+ #endif
+ AFS_GLOCK();
+ code = afs_fsync(VTOAFS(ip), credp);
+ AFS_GUNLOCK();
+ #if defined(FOP_FSYNC_TAKES_RANGE)
+- mutex_unlock(&ip->i_mutex);
++ afs_linux_unlock_inode(ip);
+ #endif
+ crfree(credp);
+ return afs_convert_code(code);
+--
+2.8.2
+
diff --git a/PKGBUILD b/PKGBUILD
index b10bae5a7e7e..8e672ce0ea32 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
pkgname=openafs-modules-dkms
_srcname=openafs
-pkgver=1.6.17
+pkgver=1.6.18
pkgrel=1
pkgdesc="Kernel module for OpenAFS (dkms)"
arch=('i686' 'x86_64' 'armv7h')
@@ -17,22 +17,28 @@ conflicts=('openafs-features-libafs' 'openafs-modules' 'openafs<1.6.6-2')
options=(!emptydirs)
source=(http://openafs.org/dl/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2
dkms.conf
- 0001-Linux-4.4-key_payload-has-no-member-value.patch
- 0002-Linux-4.4-Use-locks_lock_file_wait.patch
- 0003-Linux-4.4-Do-not-use-splice.patch)
-sha256sums=('96413a2dbffdc9170cc5dde6aa5ad0ae2383c6106994285ed8f186928813a398'
+ 0001-Linux-3.13-Check-return-value-from-bdi_init.patch
+ 0002-Linux-4.5-no-highmem-in-symlink-ops.patch
+ 0003-Linux-4.5-get_link-instead-of-follow_link-put_link.patch
+ 0004-Linux-lock-the-parent-dentry-for-lookup_one_len.patch
+ 0005-Linux-4.5-don-t-access-i_mutex-directly.patch)
+sha256sums=('b3c35e7be6b6c86b91e7c699fd015f53c87bc19d1ae8ec3ec9cda6b97327d3b6'
'ea7d1e6dfb5006016e25738be722c8793765f52ad55c0bbf588dd7fdf2bdd2bf'
- 'f498b60b99f75a2cfbe01cc91c5de0585c225231b4850816c8b080edd7402a98'
- 'ff962b1bcfeedaed0f74570e8d248b4e42a3391654bf49b4bb25e19d80b6c4ac'
- '2c2c14f2f1f88eb43a7160f3112cd63e4ea74884322b76b71308b88b32caafdb')
+ 'bec998ce038349025fe030c692f7f0fe46bbe8922433cf6be6298aac536f34cf'
+ 'd18b1278c097825801fa1c721cae861f985d9da5460475b74cefe1eb789a1f92'
+ '6336dde35c68c74ae9427b312f170481616d8d347ec4ddfa2966a683797361b0'
+ 'fa485ab7a54499eb87b91ec8ea3f33e0894e9e4dc1d0bb825d5ac84a2f3cbc93'
+ 'e3f369f000df13a4d207c1533d63ffa0b139c3d374294f6d1fbc77f5e5b9b4df')
prepare() {
cd ${srcdir}/${_srcname}-${pkgver}
- # Patches required to build against Linux 4.4
- patch -p1 < ${srcdir}/0001-Linux-4.4-key_payload-has-no-member-value.patch
- patch -p1 < ${srcdir}/0002-Linux-4.4-Use-locks_lock_file_wait.patch
- patch -p1 < ${srcdir}/0003-Linux-4.4-Do-not-use-splice.patch
+ # Patches required to build against Linux 4.5
+ patch -p1 < ${srcdir}/0001-Linux-3.13-Check-return-value-from-bdi_init.patch
+ patch -p1 < ${srcdir}/0002-Linux-4.5-no-highmem-in-symlink-ops.patch
+ patch -p1 < ${srcdir}/0003-Linux-4.5-get_link-instead-of-follow_link-put_link.patch
+ patch -p1 < ${srcdir}/0004-Linux-lock-the-parent-dentry-for-lookup_one_len.patch
+ patch -p1 < ${srcdir}/0005-Linux-4.5-don-t-access-i_mutex-directly.patch
# Only needed when changes to configure were made
./regen.sh -q