]> git.proxmox.com Git - zfsonlinux.git/blame - zfs-patches/0034-Fix-config-issues-frame-size-and-headers.patch
bump version to 0.7.7-pve1~bpo9
[zfsonlinux.git] / zfs-patches / 0034-Fix-config-issues-frame-size-and-headers.patch
CommitLineData
75b07eca
FG
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: chrisrd <chris@onthe.net.au>
3Date: Fri, 16 Feb 2018 07:58:23 +1100
4Subject: [PATCH] Fix config issues: frame size and headers
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
91. With various (debug and/or tracing?) kernel options enabled it's
10possible for 'struct inode' and 'struct super_block' to exceed the
11default frame size, leaving errors like this in config.log:
12
13build/conftest.c:116:1: error: the frame size of 1048 bytes is larger
14than 1024 bytes [-Werror=frame-larger-than=]
15
16Fix this by removing the frame size warning for config checks
17
182. Without the correct headers included, it's possible for declarations
19to be missed, leaving errors like this in the config.log:
20
21build/conftest.c:131:14: error: ‘struct nameidata’ declared inside
22parameter list [-Werror]
23
24Fix this by adding appropriate headers.
25
26Note: Both these issues can result in silent config failures because
27the compile failure is taken to mean "this option is not supported by
28this kernel" rather than "there's something wrong with the config
29test". This can lead to something merely annoying (compile failures) to
30something potentially serious (miscompiled or misused kernel primitives
31or functions). E.g. the fixes included here resulted in these
32additional defines in zfs_config.h with linux v4.14.19:
33
34Also, drive-by whitespace fixes in config/* files which don't mention
35"GNU" (those ones look to be imported from elsewhere so leave them
36alone).
37
38Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
39Signed-off-by: Chris Dunlop <chris@onthe.net.au>
40Closes #7169
41(cherry picked from commit 5a84c60fb95ee7ca1393efe93d9d17c80497c6b6)
42Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
43---
44 config/deb.am | 8 ++++----
45 config/kernel-acl.m4 | 1 +
46 config/kernel-create-nameidata.m4 | 1 +
47 config/kernel-dentry-operations.m4 | 1 +
48 config/kernel-get-link.m4 | 2 +-
49 config/kernel-lookup-nameidata.m4 | 1 +
50 config/kernel-vm_node_stat.m4 | 2 +-
51 config/kernel.m4 | 2 +-
52 config/tgz.am | 4 ++--
53 config/user-libblkid.m4 | 2 +-
54 10 files changed, 14 insertions(+), 10 deletions(-)
55
56diff --git a/config/deb.am b/config/deb.am
57index 1b51f9316..58ab96e18 100644
58--- a/config/deb.am
59+++ b/config/deb.am
60@@ -2,16 +2,16 @@ deb-local:
61 @(if test "${HAVE_DPKGBUILD}" = "no"; then \
62 echo -e "\n" \
63 "*** Required util ${DPKGBUILD} missing. Please install the\n" \
64- "*** package for your distribution which provides ${DPKGBUILD},\n" \
65+ "*** package for your distribution which provides ${DPKGBUILD},\n" \
66 "*** re-run configure, and try again.\n"; \
67- exit 1; \
68+ exit 1; \
69 fi; \
70 if test "${HAVE_ALIEN}" = "no"; then \
71 echo -e "\n" \
72 "*** Required util ${ALIEN} missing. Please install the\n" \
73- "*** package for your distribution which provides ${ALIEN},\n" \
74+ "*** package for your distribution which provides ${ALIEN},\n" \
75 "*** re-run configure, and try again.\n"; \
76- exit 1; \
77+ exit 1; \
78 fi)
79
80 deb-kmod: deb-local rpm-kmod
81diff --git a/config/kernel-acl.m4 b/config/kernel-acl.m4
82index 311484349..02cc020e5 100644
83--- a/config/kernel-acl.m4
84+++ b/config/kernel-acl.m4
85@@ -184,6 +184,7 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
86 AC_MSG_CHECKING([whether iops->permission() wants nameidata])
87 ZFS_LINUX_TRY_COMPILE([
88 #include <linux/fs.h>
89+ #include <linux/sched.h>
90
91 int permission_fn(struct inode *inode, int mask,
92 struct nameidata *nd) { return 0; }
93diff --git a/config/kernel-create-nameidata.m4 b/config/kernel-create-nameidata.m4
94index a71490a00..d4c155c57 100644
95--- a/config/kernel-create-nameidata.m4
96+++ b/config/kernel-create-nameidata.m4
97@@ -5,6 +5,7 @@ AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
98 AC_MSG_CHECKING([whether iops->create() passes nameidata])
99 ZFS_LINUX_TRY_COMPILE([
100 #include <linux/fs.h>
101+ #include <linux/sched.h>
102
103 #ifdef HAVE_MKDIR_UMODE_T
104 int inode_create(struct inode *inode ,struct dentry *dentry,
105diff --git a/config/kernel-dentry-operations.m4 b/config/kernel-dentry-operations.m4
106index 3182490c9..61f5a27af 100644
107--- a/config/kernel-dentry-operations.m4
108+++ b/config/kernel-dentry-operations.m4
109@@ -5,6 +5,7 @@ AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
110 AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
111 ZFS_LINUX_TRY_COMPILE([
112 #include <linux/dcache.h>
113+ #include <linux/sched.h>
114
115 int revalidate (struct dentry *dentry,
116 struct nameidata *nidata) { return 0; }
117diff --git a/config/kernel-get-link.m4 b/config/kernel-get-link.m4
118index 022c49c54..3cda08c1b 100644
119--- a/config/kernel-get-link.m4
120+++ b/config/kernel-get-link.m4
121@@ -41,7 +41,7 @@ AC_DEFUN([ZFS_AC_KERNEL_FOLLOW_LINK], [
122 AC_DEFINE(HAVE_FOLLOW_LINK_NAMEIDATA, 1,
123 [iops->follow_link() nameidata])
124 ],[
125- AC_MSG_ERROR(no; please file a bug report)
126+ AC_MSG_ERROR(no; please file a bug report)
127 ])
128 ])
129 ])
130diff --git a/config/kernel-lookup-nameidata.m4 b/config/kernel-lookup-nameidata.m4
131index 43f5fb4cb..5453be5e8 100644
132--- a/config/kernel-lookup-nameidata.m4
133+++ b/config/kernel-lookup-nameidata.m4
134@@ -5,6 +5,7 @@ AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_NAMEIDATA], [
135 AC_MSG_CHECKING([whether iops->lookup() passes nameidata])
136 ZFS_LINUX_TRY_COMPILE([
137 #include <linux/fs.h>
138+ #include <linux/sched.h>
139
140 struct dentry *inode_lookup(struct inode *inode,
141 struct dentry *dentry, struct nameidata *nidata)
142diff --git a/config/kernel-vm_node_stat.m4 b/config/kernel-vm_node_stat.m4
143index e1c42f884..5dcd9d827 100644
144--- a/config/kernel-vm_node_stat.m4
145+++ b/config/kernel-vm_node_stat.m4
146@@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_VM_NODE_STAT], [
147 ZFS_LINUX_TRY_COMPILE([
148 #include <linux/mm.h>
149 #include <linux/vmstat.h>
150- ],[
151+ ],[
152 int a __attribute__ ((unused)) = NR_VM_NODE_STAT_ITEMS;
153 long x __attribute__ ((unused)) =
154 atomic_long_read(&vm_node_stat[0]);
155diff --git a/config/kernel.m4 b/config/kernel.m4
156index b83f021e8..d4a84b2b2 100644
157--- a/config/kernel.m4
158+++ b/config/kernel.m4
159@@ -722,7 +722,7 @@ AC_DEFUN([ZFS_LINUX_COMPILE_IFELSE], [
160 modpost_flag=''
161 test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
162 AS_IF(
163- [AC_TRY_COMMAND(cp conftest.c conftest.h build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag) >/dev/null && AC_TRY_COMMAND([$3])],
164+ [AC_TRY_COMMAND(cp conftest.c conftest.h build && make [$2] -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $FRAME_LARGER_THAN $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag) >/dev/null && AC_TRY_COMMAND([$3])],
165 [$4],
166 [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])]
167 )
168diff --git a/config/tgz.am b/config/tgz.am
169index 2997b1de2..0657d045d 100644
170--- a/config/tgz.am
171+++ b/config/tgz.am
172@@ -2,9 +2,9 @@ tgz-local:
173 @(if test "${HAVE_ALIEN}" = "no"; then \
174 echo -e "\n" \
175 "*** Required util ${ALIEN} missing. Please install the\n" \
176- "*** package for your distribution which provides ${ALIEN},\n" \
177+ "*** package for your distribution which provides ${ALIEN},\n" \
178 "*** re-run configure, and try again.\n"; \
179- exit 1; \
180+ exit 1; \
181 fi)
182
183 tgz-kmod: tgz-local rpm-kmod
184diff --git a/config/user-libblkid.m4 b/config/user-libblkid.m4
185index 5bc7f466a..88e6f990b 100644
186--- a/config/user-libblkid.m4
187+++ b/config/user-libblkid.m4
188@@ -6,7 +6,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_LIBBLKID], [
189 LIBBLKID=
190
191 AC_CHECK_HEADER([blkid/blkid.h], [], [AC_MSG_FAILURE([
192- *** blkid.h missing, libblkid-devel package required])])
193+ *** blkid.h missing, libblkid-devel package required])])
194
195 AC_SUBST([LIBBLKID], ["-lblkid"])
196 AC_DEFINE([HAVE_LIBBLKID], 1, [Define if you have libblkid])
197--
1982.14.2
199