Skip to content
Permalink
Browse files

Linux compat: Minimum kernel version 3.10

Increase the minimum supported kernel version from 2.6.32 to 3.10.
This removes support for the following Linux enterprise distributions.

    Distribution     | Kernel | End of Life
    ---------------- | ------ | -------------
    Ubuntu 12.04 LTS | 3.2    | Apr 28, 2017
    SLES 11          | 3.0    | Mar 32, 2019
    RHEL / CentOS 6  | 2.6.32 | Nov 30, 2020

The following changes were made as part of removing support.

* Updated `configure` to enforce a minimum kernel version as
  specified in the META file (Linux-Minimum: 3.10).

    configure: error:
        *** Cannot build against kernel version 2.6.32.
        *** The minimum supported kernel version is 3.10.

* Removed all `configure` kABI checks and matching C code for
  interfaces which solely predate the Linux 3.10 kernel.

* Updated all `configure` kABI checks to fail when an interface is
  missing which was in the 3.10 kernel up to the latest 5.1 kernel.
  Removed the HAVE_* preprocessor defines for these checks and
  updated the code to unconditionally use the verified interface.

* Inverted the detection logic in several kABI checks to match
  the new interface as it appears in 3.10 and newer and not the
  legacy interface.

* Consolidated the following checks in to individual files. Due
  the large number of changes in the checks it made sense to handle
  this now.  It would be desirable to group other related checks in
  the same fashion, but this as left as future work.

  - config/kernel-blkdev.m4 - Block device kABI checks
  - config/kernel-blk-queue.m4 - Block queue kABI checks
  - config/kernel-bio.m4 - Bio interface kABI checks

* Removed the kABI checks for sops->nr_cached_objects() and
  sops->free_cached_objects().  These interfaces are currently unused.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
  • Loading branch information...
behlendorf committed Nov 6, 2019
1 parent 734de7c commit c37a899da703bf14525d6d5f3b786ed89da3786c
Showing with 1,137 additions and 2,971 deletions.
  1. +1 −1 META
  2. +15 −143 config/kernel-acl.m4
  3. +2 −3 config/kernel-automount.m4
  4. +0 −26 config/kernel-bdev-logical-size.m4
  5. +0 −40 config/kernel-bdev-physical-size.m4
  6. +1 −5 config/kernel-bdi.m4
  7. +0 −23 config/kernel-bio-bvec-iter.m4
  8. +0 −50 config/kernel-bio-end-io-t-args.m4
  9. +0 −56 config/kernel-bio-failfast.m4
  10. +0 −102 config/kernel-bio-op.m4
  11. +0 −30 config/kernel-bio-rw-barrier.m4
  12. +0 −30 config/kernel-bio-rw-discard.m4
  13. +363 −0 config/kernel-bio.m4
  14. +0 −40 config/kernel-bio_set_dev.m4
  15. +0 −24 config/kernel-blk-queue-bdi.m4
  16. +0 −72 config/kernel-blk-queue-discard.m4
  17. +0 −56 config/kernel-blk-queue-flags.m4
  18. +0 −69 config/kernel-blk-queue-flush.m4
  19. +0 −23 config/kernel-blk-queue-max-hw-sectors.m4
  20. +0 −24 config/kernel-blk-queue-max-segments.m4
  21. +0 −54 config/kernel-blk-queue-unplug.m4
  22. +302 −0 config/kernel-blk-queue.m4
  23. +0 −24 config/kernel-blkdev-get-by-path.m4
  24. +0 −25 config/kernel-blkdev-reread-part.m4
  25. +207 −0 config/kernel-blkdev.m4
  26. +2 −6 config/kernel-block-device-operations.m4
  27. +1 −3 config/kernel-commit-metadata.m4
  28. +0 −33 config/kernel-create-nameidata.m4
  29. +0 −22 config/kernel-ctl-table-name.m4
  30. +0 −39 config/kernel-current_bio_tail.m4
  31. +5 −8 config/kernel-dentry-operations.m4
  32. +1 −3 config/kernel-discard-granularity.m4
  33. +1 −1 config/kernel-evict-inode.m4
  34. +2 −25 config/kernel-fallocate.m4
  35. +1 −2 config/kernel-fmode-t.m4
  36. +1 −3 config/kernel-follow-down-one.m4
  37. +1 −2 config/kernel-fst-mount.m4
  38. +12 −36 config/kernel-fsync.m4
  39. +1 −2 config/kernel-get-disk-ro.m4
  40. +26 −0 config/kernel-inode-create.m4
  41. +26 −0 config/kernel-inode-lookup.m4
  42. +1 −3 config/kernel-insert-inode-locked.m4
  43. +0 −23 config/kernel-invalidate-bdev-args.m4
  44. +1 −21 config/kernel-is_owner_or_cap.m4
  45. +1 −3 config/kernel-kmap-atomic-args.m4
  46. +0 −45 config/kernel-kmem-cache.m4
  47. +2 −4 config/kernel-kstrtoul.m4
  48. +1 −3 config/kernel-kuid-helpers.m4
  49. +6 −19 config/kernel-kuidgid.m4
  50. +0 −39 config/kernel-lookup-bdev.m4
  51. +0 −29 config/kernel-lookup-nameidata.m4
  52. +17 −40 config/kernel-make-request-fn.m4
  53. +1 −1 config/kernel-mkdir-umode-t.m4
  54. +0 −23 config/kernel-open-bdev-exclusive.m4
  55. +1 −2 config/kernel-pde-data.m4
  56. +1 −3 config/kernel-rwsem.m4
  57. +1 −2 config/kernel-sched.m4
  58. +1 −38 config/kernel-security-inode-init.m4
  59. +3 −4 config/kernel-set-nlink.m4
  60. +1 −2 config/kernel-sget-args.m4
  61. +1 −3 config/kernel-show-options.m4
  62. +16 −170 config/kernel-shrink.m4
  63. +0 −24 config/kernel-submit_bio.m4
  64. +0 −27 config/kernel-truncate-range.m4
  65. +1 −3 config/kernel-truncate-setsize.m4
  66. +4 −10 config/kernel-userns-capabilities.m4
  67. +1 −2 config/kernel-usleep_range.m4
  68. +1 −2 config/kernel-vfs-fsync.m4
  69. +5 −81 config/kernel-xattr-handler.m4
  70. +1 −1 config/kernel-zlib.m4
  71. +17 −58 config/kernel.m4
  72. +13 −195 include/os/linux/kernel/linux/blkdev_compat.h
  73. +0 −19 include/os/linux/kernel/linux/dcache_compat.h
  74. +0 −5 include/os/linux/kernel/linux/kmap_compat.h
  75. +9 −216 include/os/linux/kernel/linux/vfs_compat.h
  76. +6 −73 include/os/linux/kernel/linux/xattr_compat.h
  77. +0 −12 include/os/linux/spl/sys/cred.h
  78. +0 −4 include/os/linux/spl/sys/proc.h
  79. +1 −58 include/os/linux/spl/sys/shrinker.h
  80. +0 −4 include/os/linux/spl/sys/strings.h
  81. +1 −3 include/os/linux/spl/sys/sysmacros.h
  82. +0 −14 include/os/linux/spl/sys/timer.h
  83. +0 −8 include/os/linux/spl/sys/zmod.h
  84. +3 −21 include/os/linux/zfs/sys/zpl.h
  85. +1 −3 include/sys/zfs_context.h
  86. +0 −4 module/os/linux/spl/spl-cred.c
  87. +0 −5 module/os/linux/spl/spl-kmem-cache.c
  88. +0 −3 module/os/linux/spl/spl-proc.c
  89. +0 −38 module/os/linux/spl/spl-vnode.c
  90. +1 −1 module/os/linux/spl/spl-zlib.c
  91. +0 −21 module/os/linux/zfs/abd.c
  92. +9 −10 module/os/linux/zfs/policy.c
  93. +13 −53 module/os/linux/zfs/vdev_disk.c
  94. +1 −1 module/os/linux/zfs/zfs_ctldir.c
  95. +2 −9 module/os/linux/zfs/zfs_vfsops.c
  96. +1 −22 module/os/linux/zfs/zpl_ctldir.c
  97. +2 −25 module/os/linux/zfs/zpl_export.c
  98. +3 −42 module/os/linux/zfs/zpl_file.c
  99. +8 −85 module/os/linux/zfs/zpl_inode.c
  100. +1 −101 module/os/linux/zfs/zpl_super.c
  101. +5 −84 module/os/linux/zfs/zpl_xattr.c
  102. +1 −42 module/os/linux/zfs/zvol_os.c
2 META
@@ -7,4 +7,4 @@ Release-Tags: relext
License: CDDL
Author: OpenZFS on Linux
Linux-Maximum: 5.1
Linux-Minimum: 2.6.32
Linux-Minimum: 3.10
@@ -66,11 +66,10 @@ AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [

dnl #
dnl # 3.1 API change,
dnl # posix_acl_chmod_masq() is not exported anymore and posix_acl_chmod()
dnl # was introduced to replace it.
dnl # posix_acl_chmod() was added as the preferred interface.
dnl #
dnl # 3.14 API change,
dnl # posix_acl_chmod() is changed to __posix_acl_chmod()
dnl # posix_acl_chmod() was changed to __posix_acl_chmod()
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD], [
ZFS_LINUX_TEST_SRC([posix_acl_chmod], [
@@ -89,46 +88,45 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD], [
])

AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_CHMOD], [
AC_MSG_CHECKING([whether posix_acl_chmod exists])
ZFS_LINUX_TEST_RESULT([posix_acl_chmod], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1, [posix_acl_chmod() exists])
],[
AC_MSG_RESULT(no)
])

AC_MSG_CHECKING([whether __posix_acl_chmod exists])
ZFS_LINUX_TEST_RESULT([__posix_acl_chmod], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE___POSIX_ACL_CHMOD, 1,
[__posix_acl_chmod() exists])
],[
AC_MSG_RESULT(no)

AC_MSG_CHECKING([whether posix_acl_chmod exists])
ZFS_LINUX_TEST_RESULT([posix_acl_chmod], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1,
[posix_acl_chmod() exists])
],[
ZFS_LINUX_TEST_ERROR([posix_acl_chmod()])
])
])
])

dnl #
dnl # 3.1 API change,
dnl # posix_acl_equiv_mode now wants an umode_t* instead of a mode_t*
dnl # posix_acl_equiv_mode now wants an umode_t instead of a mode_t
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
ZFS_LINUX_TEST_SRC([posix_acl_equiv_mode], [
#include <linux/fs.h>
#include <linux/posix_acl.h>
],[
umode_t tmp;
posix_acl_equiv_mode(NULL,&tmp);
posix_acl_equiv_mode(NULL, &tmp);
])
])

AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T], [
AC_MSG_CHECKING([whether posix_acl_equiv_mode() wants umode_t])
ZFS_LINUX_TEST_RESULT([posix_acl_equiv_mode], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_POSIX_ACL_EQUIV_MODE_UMODE_T, 1,
[posix_acl_equiv_mode wants umode_t*])
],[
AC_MSG_RESULT(no)
ZFS_LINUX_TEST_ERROR([posix_acl_equiv_mode()])
])
])

@@ -160,123 +158,6 @@ AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS], [
])
])

dnl #
dnl # 2.6.27 API change,
dnl # Check if inode_operations contains the function permission
dnl # and expects the nameidata structure to have been removed.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION], [
ZFS_LINUX_TEST_SRC([inode_operations_permission], [
#include <linux/fs.h>

int permission_fn(struct inode *inode, int mask) { return 0; }

static const struct inode_operations
iops __attribute__ ((unused)) = {
.permission = permission_fn,
};
],[])
])

AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION], [
AC_MSG_CHECKING([whether iops->permission() exists])
ZFS_LINUX_TEST_RESULT([inode_operations_permission], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists])
],[
AC_MSG_RESULT(no)
])
])

dnl #
dnl # 2.6.26 API change,
dnl # Check if inode_operations contains the function permission
dnl # and expects the nameidata structure to be passed.
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
ZFS_LINUX_TEST_SRC([inode_operations_permission_with_nameidata], [
#include <linux/fs.h>
#include <linux/sched.h>

int permission_fn(struct inode *inode, int mask,
struct nameidata *nd) { return 0; }

static const struct inode_operations
iops __attribute__ ((unused)) = {
.permission = permission_fn,
};
],[])
])

AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA], [
AC_MSG_CHECKING([whether iops->permission() wants nameidata])
ZFS_LINUX_TEST_RESULT([inode_operations_permission_with_nameidata], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PERMISSION, 1, [iops->permission() exists])
AC_DEFINE(HAVE_PERMISSION_WITH_NAMEIDATA, 1,
[iops->permission() with nameidata exists])
],[
AC_MSG_RESULT(no)
])
])

dnl #
dnl # 2.6.32 API change,
dnl # Check if inode_operations contains the function check_acl
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL], [
ZFS_LINUX_TEST_SRC([inode_operations_check_acl], [
#include <linux/fs.h>

int check_acl_fn(struct inode *inode, int mask) { return 0; }

static const struct inode_operations
iops __attribute__ ((unused)) = {
.check_acl = check_acl_fn,
};
],[])
])

AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL], [
AC_MSG_CHECKING([whether iops->check_acl() exists])
ZFS_LINUX_TEST_RESULT([inode_operations_check_acl], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists])
],[
AC_MSG_RESULT(no)
])
])

dnl #
dnl # 2.6.38 API change,
dnl # The function check_acl gained a new parameter: flags
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [
ZFS_LINUX_TEST_SRC([inode_operations_check_acl_with_flags], [
#include <linux/fs.h>

int check_acl_fn(struct inode *inode, int mask,
unsigned int flags) { return 0; }

static const struct inode_operations
iops __attribute__ ((unused)) = {
.check_acl = check_acl_fn,
};
],[])
])

AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS], [
AC_MSG_CHECKING([whether iops->check_acl() wants flags])
ZFS_LINUX_TEST_RESULT([inode_operations_check_acl_with_flags], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_CHECK_ACL, 1, [iops->check_acl() exists])
AC_DEFINE(HAVE_CHECK_ACL_WITH_FLAGS, 1,
[iops->check_acl() wants flags])
],[
AC_MSG_RESULT(no)
])
])

dnl #
dnl # 3.1 API change,
dnl # Check if inode_operations contains the function get_acl
@@ -299,9 +180,8 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL], [
AC_MSG_CHECKING([whether iops->get_acl() exists])
ZFS_LINUX_TEST_RESULT([inode_operations_get_acl], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GET_ACL, 1, [iops->get_acl() exists])
],[
AC_MSG_RESULT(no)
ZFS_LINUX_TEST_ERROR([iops->get_acl()])
])
])

@@ -390,10 +270,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [
ZFS_AC_KERNEL_SRC_POSIX_ACL_CHMOD
ZFS_AC_KERNEL_SRC_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL
ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL
ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE
@@ -406,10 +282,6 @@ AC_DEFUN([ZFS_AC_KERNEL_ACL], [
ZFS_AC_KERNEL_POSIX_ACL_CHMOD
ZFS_AC_KERNEL_POSIX_ACL_EQUIV_MODE_WANTS_UMODE_T
ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS
ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION
ZFS_AC_KERNEL_INODE_OPERATIONS_PERMISSION_WITH_NAMEIDATA
ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL
ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS
ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL
ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE
@@ -12,15 +12,14 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_AUTOMOUNT], [
struct dentry_operations dops __attribute__ ((unused)) = {
.d_automount = d_automount,
};
],[])
])
])

AC_DEFUN([ZFS_AC_KERNEL_AUTOMOUNT], [
AC_MSG_CHECKING([whether dops->d_automount() exists])
ZFS_LINUX_TEST_RESULT([dentry_operations_d_automount], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_AUTOMOUNT, 1, [dops->automount() exists])
],[
AC_MSG_RESULT(no)
ZFS_LINUX_TEST_ERROR([dops->d_automount()])
])
])

This file was deleted.

This file was deleted.

@@ -72,11 +72,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BDI], [
AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
[bdi_setup_and_register() wants 3 args])
], [
dnl #
dnl # 2.6.32 - 2.6.33, bdi_setup_and_register()
dnl # is not exported.
dnl #
AC_MSG_RESULT(no)
ZFS_LINUX_TEST_ERROR([bdi_setup])
])
])
])

This file was deleted.

0 comments on commit c37a899

Please sign in to comment.
You can’t perform that action at this time.