summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lass2017-11-13 20:26:12 +0100
committerMichael Lass2017-11-13 20:28:40 +0100
commit822cb8f5752b0d98fe5ac1a9f83260877139facf (patch)
tree4c19bdecd571336f37c95ddd414bb15b34a6d195
parent34963e563a7c7a6f87ffac625e851828f57e9965 (diff)
downloadaur-822cb8f5752b0d98fe5ac1a9f83260877139facf.tar.gz
Add patches for Linux 4.14
-rw-r--r--.SRCINFO10
-rw-r--r--0001-Correct-m4-conditionals-in-curses.m4.patch4
-rw-r--r--0002-Linux-Test-for-__vfs_write-rather-than-__vfs_read.patch99
-rw-r--r--0003-Linux-Use-kernel_read-kernel_write-when-__vfs-varian.patch142
-rw-r--r--PKGBUILD14
5 files changed, 261 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 282bb65a1cf..ef45306b95e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Mon Oct 23 16:41:48 UTC 2017
+# Mon Nov 13 19:26:05 UTC 2017
pkgbase = openafs-modules
pkgdesc = Kernel module for OpenAFS
pkgver = 1.6.21.1
- pkgrel = 1
+ pkgrel = 2
url = http://www.openafs.org
install = openafs-modules.install
arch = i686
@@ -17,8 +17,12 @@ pkgbase = openafs-modules
options = !emptydirs
source = http://openafs.org/dl/1.6.21.1/openafs-1.6.21.1-src.tar.bz2
source = 0001-Correct-m4-conditionals-in-curses.m4.patch
+ source = 0002-Linux-Test-for-__vfs_write-rather-than-__vfs_read.patch
+ source = 0003-Linux-Use-kernel_read-kernel_write-when-__vfs-varian.patch
sha256sums = aed896b0f598e3033e9ceb2a1eae24addff9ec0bb2d713ab63945a449ded3a5a
- sha256sums = 588cc4b220b7bd4783ffb44d9bfd490a67d1d4a58da20b952151fd842ca8f18d
+ sha256sums = 250145d4abd704f739ade491e8d685873813a720b954f6c09a6186fb8662c415
+ sha256sums = 28511f96c142eb918c4f92bf43427883f3f9eb32a8ea8a4de85b56c1b57957a4
+ sha256sums = 4040a57c012498c06d60b678b072d6ce415f7b8b1a6fc01140b42c392515da36
pkgname = openafs-modules
diff --git a/0001-Correct-m4-conditionals-in-curses.m4.patch b/0001-Correct-m4-conditionals-in-curses.m4.patch
index 7e57fc07d4e..96f336c5cd7 100644
--- a/0001-Correct-m4-conditionals-in-curses.m4.patch
+++ b/0001-Correct-m4-conditionals-in-curses.m4.patch
@@ -1,7 +1,7 @@
From 86ccc8d7c3bc57d5011474a8a5da228ea851104a Mon Sep 17 00:00:00 2001
From: Benjamin Kaduk <kaduk@mit.edu>
Date: Mon, 16 Oct 2017 16:53:22 -0500
-Subject: [PATCH] Correct m4 conditionals in curses.m4
+Subject: [PATCH 1/3] Correct m4 conditionals in curses.m4
AS_IF does not invoke the test(1) shell builtin for us, so we must
take care to consistently use it ourself.
@@ -63,5 +63,5 @@ index a0cdc60f1..dc01469f5 100644
dnl The top level curses group
AC_DEFUN([OPENAFS_CURSES],
--
-2.14.2
+2.15.0
diff --git a/0002-Linux-Test-for-__vfs_write-rather-than-__vfs_read.patch b/0002-Linux-Test-for-__vfs_write-rather-than-__vfs_read.patch
new file mode 100644
index 00000000000..e5d0d16992a
--- /dev/null
+++ b/0002-Linux-Test-for-__vfs_write-rather-than-__vfs_read.patch
@@ -0,0 +1,99 @@
+From e5a30e15337cf008d253ae3368d6421ab27e8f2d Mon Sep 17 00:00:00 2001
+From: Damien Diederen <ddiederen@sinenomine.net>
+Date: Mon, 18 Sep 2017 11:59:40 +0200
+Subject: [PATCH 2/3] Linux: Test for __vfs_write rather than __vfs_read
+
+The following commit:
+
+ commit eb031849d52e61d24ba54e9d27553189ff328174
+ Author: Christoph Hellwig <hch@lst.de>
+ Date: Fri Sep 1 17:39:23 2017 +0200
+
+ fs: unexport __vfs_read/__vfs_write
+
+unexports both __vfs_read and __vfs_write, but keeps the former in
+fs.h--as it is is still being used by another part of the tree.
+
+This situation results in a false positive in our Autoconf check,
+which does not see the export statements, and ends up marking the
+corresponding API as available.
+
+That, in turn, causes some code which assumes symmetry with
+__vfs_write to fail to compile.
+
+Switch to testing for __vfs_write, which correctly marks the API as
+unavailable.
+
+Reviewed-on: https://gerrit.openafs.org/12728
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 929e77a886fc9853ee292ba1aa52a920c454e94b)
+
+Reviewed-on: https://gerrit.openafs.org/12736
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit c42a25d28fbcc76fdcac2b5f29704f8f1b353b45)
+
+Change-Id: I27c1c67bed6ebb922389ebb70cbb7fc238378b58
+---
+ acinclude.m4 | 4 ++--
+ src/afs/LINUX/osi_compat.h | 4 ++--
+ src/afs/LINUX/osi_vnodeops.c | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index d80cacd78..8353ca597 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -939,9 +939,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+
+ dnl Function existence checks
+
+- AC_CHECK_LINUX_FUNC([__vfs_read],
++ AC_CHECK_LINUX_FUNC([__vfs_write],
+ [#include <linux/fs.h>],
+- [__vfs_read(NULL, NULL, 0, NULL);])
++ [__vfs_write(NULL, NULL, 0, NULL);])
+ AC_CHECK_LINUX_FUNC([bdi_init],
+ [#include <linux/backing-dev.h>],
+ [bdi_init(NULL);])
+diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
+index 8e72161bf..9ebe9c178 100644
+--- a/src/afs/LINUX/osi_compat.h
++++ b/src/afs/LINUX/osi_compat.h
+@@ -595,7 +595,7 @@ afs_d_invalidate(struct dentry *dp)
+ static inline int
+ afs_file_read(struct file *filp, char __user *buf, size_t len, loff_t *pos)
+ {
+-#if defined(HAVE_LINUX___VFS_READ)
++#if defined(HAVE_LINUX___VFS_WRITE)
+ return __vfs_read(filp, buf, len, pos);
+ #else
+ return filp->f_op->read(filp, buf, len, pos);
+@@ -605,7 +605,7 @@ afs_file_read(struct file *filp, char __user *buf, size_t len, loff_t *pos)
+ static inline int
+ afs_file_write(struct file *filp, char __user *buf, size_t len, loff_t *pos)
+ {
+-#if defined(HAVE_LINUX___VFS_READ)
++#if defined(HAVE_LINUX___VFS_WRITE)
+ return __vfs_write(filp, buf, len, pos);
+ #else
+ return filp->f_op->write(filp, buf, len, pos);
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index f46d8dda8..3d9d71791 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -807,7 +807,7 @@ struct file_operations afs_file_fops = {
+ #ifdef STRUCT_FILE_OPERATIONS_HAS_READ_ITER
+ .read_iter = afs_linux_read_iter,
+ .write_iter = afs_linux_write_iter,
+-# if !defined(HAVE_LINUX___VFS_READ)
++# if !defined(HAVE_LINUX___VFS_WRITE)
+ .read = new_sync_read,
+ .write = new_sync_write,
+ # endif
+--
+2.15.0
+
diff --git a/0003-Linux-Use-kernel_read-kernel_write-when-__vfs-varian.patch b/0003-Linux-Use-kernel_read-kernel_write-when-__vfs-varian.patch
new file mode 100644
index 00000000000..e9530743b81
--- /dev/null
+++ b/0003-Linux-Use-kernel_read-kernel_write-when-__vfs-varian.patch
@@ -0,0 +1,142 @@
+From 8c11a97ec0991800c12311a123134f8b5fd59f5e Mon Sep 17 00:00:00 2001
+From: Damien Diederen <ddiederen@sinenomine.net>
+Date: Mon, 18 Sep 2017 12:18:39 +0200
+Subject: [PATCH 3/3] Linux: Use kernel_read/kernel_write when __vfs variants
+ are unavailable
+
+We hide the uses of set_fs/get_fs behind a macro, as those functions
+are likely to soon become unavailable:
+
+> Christoph Hellwig suggested removing all calls outside of the core
+> filesystem and architecture code; Andy Lutomirski went one step
+> further and said they should all go.
+
+ https://lwn.net/Articles/722267/
+
+Reviewed-on: https://gerrit.openafs.org/12729
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit 5ee516b3789d3545f3d78fb3aba2480308359945)
+
+Reviewed-on: https://gerrit.openafs.org/12737
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
+Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit d93f80622370f50d7bce5c5b00cd062f15ee9eba)
+
+Change-Id: Ib4515c858d0a06d3706ec7de212c35551d3e7240
+---
+ acinclude.m4 | 3 +++
+ src/afs/LINUX/osi_compat.h | 12 ++++++++++++
+ src/afs/LINUX/osi_file.c | 6 ++++++
+ src/afs/LINUX/osi_vnodeops.c | 2 +-
+ 4 files changed, 22 insertions(+), 1 deletion(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 8353ca597..94b943622 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -942,6 +942,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ AC_CHECK_LINUX_FUNC([__vfs_write],
+ [#include <linux/fs.h>],
+ [__vfs_write(NULL, NULL, 0, NULL);])
++ AC_CHECK_LINUX_FUNC([kernel_write],
++ [#include <linux/fs.h>],
++ [kernel_write(NULL, NULL, 0, NULL);])
+ AC_CHECK_LINUX_FUNC([bdi_init],
+ [#include <linux/backing-dev.h>],
+ [bdi_init(NULL);])
+diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
+index 9ebe9c178..9871535f0 100644
+--- a/src/afs/LINUX/osi_compat.h
++++ b/src/afs/LINUX/osi_compat.h
+@@ -592,11 +592,21 @@ afs_d_invalidate(struct dentry *dp)
+ #endif
+ }
+
++#if defined(HAVE_LINUX___VFS_WRITE)
++# define AFS_FILE_NEEDS_SET_FS 1
++#elif defined(HAVE_LINUX_KERNEL_WRITE)
++/* #undef AFS_FILE_NEEDS_SET_FS */
++#else
++# define AFS_FILE_NEEDS_SET_FS 1
++#endif
++
+ static inline int
+ afs_file_read(struct file *filp, char __user *buf, size_t len, loff_t *pos)
+ {
+ #if defined(HAVE_LINUX___VFS_WRITE)
+ return __vfs_read(filp, buf, len, pos);
++#elif defined(HAVE_LINUX_KERNEL_WRITE)
++ return kernel_read(filp, buf, len, pos);
+ #else
+ return filp->f_op->read(filp, buf, len, pos);
+ #endif
+@@ -607,6 +617,8 @@ afs_file_write(struct file *filp, char __user *buf, size_t len, loff_t *pos)
+ {
+ #if defined(HAVE_LINUX___VFS_WRITE)
+ return __vfs_write(filp, buf, len, pos);
++#elif defined(HAVE_LINUX_KERNEL_WRITE)
++ return kernel_write(filp, buf, len, pos);
+ #else
+ return filp->f_op->write(filp, buf, len, pos);
+ #endif
+diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c
+index f889fd16b..a028ee740 100644
+--- a/src/afs/LINUX/osi_file.c
++++ b/src/afs/LINUX/osi_file.c
+@@ -357,7 +357,9 @@ int
+ osi_rdwr(struct osi_file *osifile, struct uio *uiop, int rw)
+ {
+ struct file *filp = osifile->filp;
++#ifdef AFS_FILE_NEEDS_SET_FS
+ mm_segment_t old_fs = {0};
++#endif /* AFS_FILE_NEEDS_SET_FS */
+ int code = 0;
+ struct iovec *iov;
+ size_t count;
+@@ -367,11 +369,13 @@ osi_rdwr(struct osi_file *osifile, struct uio *uiop, int rw)
+ savelim = current->TASK_STRUCT_RLIM[RLIMIT_FSIZE].rlim_cur;
+ current->TASK_STRUCT_RLIM[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY;
+
++#ifdef AFS_FILE_NEEDS_SET_FS
+ if (uiop->uio_seg == AFS_UIOSYS) {
+ /* Switch into user space */
+ old_fs = get_fs();
+ set_fs(get_ds());
+ }
++#endif /* AFS_FILE_NEEDS_SET_FS */
+
+ while (code == 0 && uiop->uio_resid > 0 && uiop->uio_iovcnt > 0) {
+ iov = uiop->uio_iov;
+@@ -408,10 +412,12 @@ osi_rdwr(struct osi_file *osifile, struct uio *uiop, int rw)
+ code = 0;
+ }
+
++#ifdef AFS_FILE_NEEDS_SET_FS
+ if (uiop->uio_seg == AFS_UIOSYS) {
+ /* Switch back into kernel space */
+ set_fs(old_fs);
+ }
++#endif /* AFS_FILE_NEEDS_SET_FS */
+
+ current->TASK_STRUCT_RLIM[RLIMIT_FSIZE].rlim_cur = savelim;
+
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 3d9d71791..051452b34 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -807,7 +807,7 @@ struct file_operations afs_file_fops = {
+ #ifdef STRUCT_FILE_OPERATIONS_HAS_READ_ITER
+ .read_iter = afs_linux_read_iter,
+ .write_iter = afs_linux_write_iter,
+-# if !defined(HAVE_LINUX___VFS_WRITE)
++# if !defined(HAVE_LINUX___VFS_WRITE) && !defined(HAVE_LINUX_KERNEL_WRITE)
+ .read = new_sync_read,
+ .write = new_sync_write,
+ # endif
+--
+2.15.0
+
diff --git a/PKGBUILD b/PKGBUILD
index a7672df4f73..a514cae274a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@
pkgname=openafs-modules
_srcname=openafs
pkgver=1.6.21.1
-pkgrel=1
+pkgrel=2
pkgdesc="Kernel module for OpenAFS"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.openafs.org"
@@ -16,10 +16,14 @@ makedepends=('linux-headers')
conflicts=('openafs-features-libafs' 'openafs<1.6.6-2')
options=(!emptydirs)
source=(http://openafs.org/dl/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2
- 0001-Correct-m4-conditionals-in-curses.m4.patch)
+ 0001-Correct-m4-conditionals-in-curses.m4.patch
+ 0002-Linux-Test-for-__vfs_write-rather-than-__vfs_read.patch
+ 0003-Linux-Use-kernel_read-kernel_write-when-__vfs-varian.patch)
install=openafs-modules.install
sha256sums=('aed896b0f598e3033e9ceb2a1eae24addff9ec0bb2d713ab63945a449ded3a5a'
- '588cc4b220b7bd4783ffb44d9bfd490a67d1d4a58da20b952151fd842ca8f18d')
+ '250145d4abd704f739ade491e8d685873813a720b954f6c09a6186fb8662c415'
+ '28511f96c142eb918c4f92bf43427883f3f9eb32a8ea8a4de85b56c1b57957a4'
+ '4040a57c012498c06d60b678b072d6ce415f7b8b1a6fc01140b42c392515da36')
# Heuristic to determine version of installed kernel
# You can modify this if the heuristic fails
@@ -32,6 +36,10 @@ prepare() {
# Fix curses checks during configure (https://gerrit.openafs.org/12740/)
patch -p1 < ${srcdir}/0001-Correct-m4-conditionals-in-curses.m4.patch
+ # Fix compatibility with Linux 4.14
+ patch -p1 < ${srcdir}/0002-Linux-Test-for-__vfs_write-rather-than-__vfs_read.patch
+ patch -p1 < ${srcdir}/0003-Linux-Use-kernel_read-kernel_write-when-__vfs-varian.patch
+
# Only needed when changes to configure were made
./regen.sh -q
}