]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix config issues: frame size and headers
authorchrisrd <chris@onthe.net.au>
Thu, 15 Feb 2018 20:58:23 +0000 (07:58 +1100)
committerTony Hutter <hutter2@llnl.gov>
Wed, 14 Mar 2018 23:10:37 +0000 (16:10 -0700)
1. With various (debug and/or tracing?) kernel options enabled it's
possible for 'struct inode' and 'struct super_block' to exceed the
default frame size, leaving errors like this in config.log:

build/conftest.c:116:1: error: the frame size of 1048 bytes is larger
than 1024 bytes [-Werror=frame-larger-than=]

Fix this by removing the frame size warning for config checks

2. Without the correct headers included, it's possible for declarations
to be missed, leaving errors like this in the config.log:

build/conftest.c:131:14: error: ‘struct nameidata’ declared inside
parameter list [-Werror]

Fix this by adding appropriate headers.

Note: Both these issues can result in silent config failures because
the compile failure is taken to mean "this option is not supported by
this kernel" rather than "there's something wrong with the config
test". This can lead to something merely annoying (compile failures) to
something potentially serious (miscompiled or misused kernel primitives
or functions). E.g. the fixes included here resulted in these
additional defines in zfs_config.h with linux v4.14.19:

Also, drive-by whitespace fixes in config/* files which don't mention
"GNU" (those ones look to be imported from elsewhere so leave them
alone).

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chris Dunlop <chris@onthe.net.au>
Closes #7169

config/deb.am
config/kernel-acl.m4
config/kernel-create-nameidata.m4
config/kernel-dentry-operations.m4
config/kernel-get-link.m4
config/kernel-lookup-nameidata.m4
config/kernel-vm_node_stat.m4
config/kernel.m4
config/tgz.am
config/user-libblkid.m4

index 1b51f93163a0299c47a26a43c2d8738d461191bb..58ab96e186ada6892ea2b5cb17fa8f896035b4f1 100644 (file)
@@ -2,16 +2,16 @@ deb-local:
        @(if test "${HAVE_DPKGBUILD}" = "no"; then \
                echo -e "\n" \
        "*** Required util ${DPKGBUILD} missing.  Please install the\n" \
-        "*** package for your distribution which provides ${DPKGBUILD},\n" \
+       "*** package for your distribution which provides ${DPKGBUILD},\n" \
        "*** re-run configure, and try again.\n"; \
-                exit 1; \
+               exit 1; \
        fi; \
        if test "${HAVE_ALIEN}" = "no"; then \
                echo -e "\n" \
        "*** Required util ${ALIEN} missing.  Please install the\n" \
-        "*** package for your distribution which provides ${ALIEN},\n" \
+       "*** package for your distribution which provides ${ALIEN},\n" \
        "*** re-run configure, and try again.\n"; \
-                exit 1; \
+               exit 1; \
        fi)
 
 deb-kmod: deb-local rpm-kmod
index 311484349d4a4c418e9d8baccc5e26074ed07a56..02cc020e5c90554e364f117e7cf5034cc98daca6 100644 (file)
@@ -184,6 +184,7 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
        AC_MSG_CHECKING([whether iops->permission() wants nameidata])
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/fs.h>
+               #include <linux/sched.h>
 
                int permission_fn(struct inode *inode, int mask,
                    struct nameidata *nd) { return 0; }
index a71490a004a65fadf54e83875a1dd51138bd894f..d4c155c57fc9171050a83fb78a3aa11640381134 100644 (file)
@@ -5,6 +5,7 @@ AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
        AC_MSG_CHECKING([whether iops->create() passes nameidata])
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/fs.h>
+               #include <linux/sched.h>
 
                #ifdef HAVE_MKDIR_UMODE_T
                int inode_create(struct inode *inode ,struct dentry *dentry,
index 3182490c908c8737bd33f072efc35cd1dce61d16..61f5a27af5a782baef51f903794eecc60920d704 100644 (file)
@@ -5,6 +5,7 @@ AC_DEFUN([ZFS_AC_KERNEL_D_REVALIDATE_NAMEIDATA], [
        AC_MSG_CHECKING([whether dops->d_revalidate() takes struct nameidata])
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/dcache.h>
+               #include <linux/sched.h>
 
                int revalidate (struct dentry *dentry,
                    struct nameidata *nidata) { return 0; }
index 022c49c54de7d371e1993d0f92310c004bc2aa69..3cda08c1b4d5ab03d18caf9d002d5d6374200fd0 100644 (file)
@@ -41,7 +41,7 @@ AC_DEFUN([ZFS_AC_KERNEL_FOLLOW_LINK], [
                        AC_DEFINE(HAVE_FOLLOW_LINK_NAMEIDATA, 1,
                                  [iops->follow_link() nameidata])
                ],[
-                        AC_MSG_ERROR(no; please file a bug report)
+                       AC_MSG_ERROR(no; please file a bug report)
                ])
        ])
 ])
index 43f5fb4cbc7bf9ee97cf02ab43e5963e72fa3c64..5453be5e8e38c7adf169bf1a5baee586da21c4f4 100644 (file)
@@ -5,6 +5,7 @@ AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_NAMEIDATA], [
        AC_MSG_CHECKING([whether iops->lookup() passes nameidata])
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/fs.h>
+               #include <linux/sched.h>
 
                struct dentry *inode_lookup(struct inode *inode,
                    struct dentry *dentry, struct nameidata *nidata)
index e1c42f884b0b8a764b87624ddb1bdbad97200b77..5dcd9d8275f2fc873c644e2c913b4113bb2954ef 100644 (file)
@@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_KERNEL_VM_NODE_STAT], [
        ZFS_LINUX_TRY_COMPILE([
                #include <linux/mm.h>
                #include <linux/vmstat.h>
-        ],[
+       ],[
                        int a __attribute__ ((unused)) = NR_VM_NODE_STAT_ITEMS;
                        long x __attribute__ ((unused)) =
                                atomic_long_read(&vm_node_stat[0]);
index b83f021e87a83f90668113fc8b2e5a323017b2d9..d4a84b2b2847d9660c9d72b4da4b162aea59c462 100644 (file)
@@ -722,7 +722,7 @@ AC_DEFUN([ZFS_LINUX_COMPILE_IFELSE], [
        modpost_flag=''
        test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
        AS_IF(
-               [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])],
+               [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])],
                [$4],
                [_AC_MSG_LOG_CONFTEST m4_ifvaln([$5],[$5])]
        )
index 2997b1de230629e01553bd19b7129f4b78cd4ad4..0657d045d1642bccf2a591bb0e2463e42d4ac03a 100644 (file)
@@ -2,9 +2,9 @@ tgz-local:
        @(if test "${HAVE_ALIEN}" = "no"; then \
                echo -e "\n" \
        "*** Required util ${ALIEN} missing.  Please install the\n" \
-        "*** package for your distribution which provides ${ALIEN},\n" \
+       "*** package for your distribution which provides ${ALIEN},\n" \
        "*** re-run configure, and try again.\n"; \
-                exit 1; \
+               exit 1; \
        fi)
 
 tgz-kmod: tgz-local rpm-kmod
index 5bc7f466ae7a6387e25ddd7bf382be7d54968765..88e6f990b74a15421430b4213b205916d9c6b589 100644 (file)
@@ -6,7 +6,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_LIBBLKID], [
        LIBBLKID=
 
        AC_CHECK_HEADER([blkid/blkid.h], [], [AC_MSG_FAILURE([
-        *** blkid.h missing, libblkid-devel package required])])
+       *** blkid.h missing, libblkid-devel package required])])
 
        AC_SUBST([LIBBLKID], ["-lblkid"])
        AC_DEFINE([HAVE_LIBBLKID], 1, [Define if you have libblkid])