]> git.proxmox.com Git - zfsonlinux.git/blob - zfs-patches/0028-Fix-incompatibility-with-Reiser4-patched-kernels.patch
buildsys: upload to pmg as well
[zfsonlinux.git] / zfs-patches / 0028-Fix-incompatibility-with-Reiser4-patched-kernels.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Richard Yao <ryao@gentoo.org>
3 Date: Tue, 9 Jan 2018 19:18:19 -0500
4 Subject: [PATCH] Fix incompatibility with Reiser4 patched kernels
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 In ZFSOnLinux, our sources and build system are self contained such that
10 we do not need to make changes to the Linux kernel sources. Reiser4 on
11 the other hand exists solely as a kernel tree patch and opts to make
12 changes to the kernel rather than adapt to it. After Linux 4.1 made a
13 VFS change that replaced new_sync_read with do_sync_read, Reiser4's
14 maintainer decided to modify the kernel VFS to export the old function.
15 This caused our autotools check to misidentify the kernel API as
16 predating Linux 4.1 on kernels that have been patched with Reiser4
17 support, which breaks our build.
18
19 Reiser4 really should be patched to stop doing this, but lets modify our
20 check to be more strict to help the affected users of both filesystems.
21
22 Also, we were not checking the types of arguments and return value of
23 new_sync_read() and new_sync_write() . Lets fix that too.
24
25 Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
26 Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
27 Reviewed-by: George Melikov <mail@gmelikov.ru>
28 Signed-off-by: Richard Yao <ryao@gentoo.org>
29 Closes #6241
30 Closes #7021
31 (cherry picked from commit ecc8af18125728bf03841ceb48b057e15d96362c)
32 Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
33 ---
34 config/kernel-vfs-rw-iterate.m4 | 14 +++++++++++---
35 1 file changed, 11 insertions(+), 3 deletions(-)
36
37 diff --git a/config/kernel-vfs-rw-iterate.m4 b/config/kernel-vfs-rw-iterate.m4
38 index 9f8fe6559..ace54f707 100644
39 --- a/config/kernel-vfs-rw-iterate.m4
40 +++ b/config/kernel-vfs-rw-iterate.m4
41 @@ -32,15 +32,23 @@ dnl #
42 dnl # Linux 4.1 API
43 dnl #
44 AC_DEFUN([ZFS_AC_KERNEL_NEW_SYNC_READ],
45 - [AC_MSG_CHECKING([whether new_sync_read() is available])
46 + [AC_MSG_CHECKING([whether new_sync_read/write() are available])
47 ZFS_LINUX_TRY_COMPILE([
48 #include <linux/fs.h>
49 ],[
50 - new_sync_read(NULL, NULL, 0, NULL);
51 + ssize_t ret __attribute__ ((unused));
52 + struct file *filp = NULL;
53 + char __user *rbuf = NULL;
54 + const char __user *wbuf = NULL;
55 + size_t len = 0;
56 + loff_t ppos;
57 +
58 + ret = new_sync_read(filp, rbuf, len, &ppos);
59 + ret = new_sync_write(filp, wbuf, len, &ppos);
60 ],[
61 AC_MSG_RESULT(yes)
62 AC_DEFINE(HAVE_NEW_SYNC_READ, 1,
63 - [new_sync_read() is available])
64 + [new_sync_read()/new_sync_write() are available])
65 ],[
66 AC_MSG_RESULT(no)
67 ])
68 --
69 2.14.2
70