From a40444197b52e503c3ad46b3c9b7184ccc484b4e Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Fri, 16 Aug 2024 17:00:43 +1000 Subject: [PATCH] config: remove HAVE_KERNEL_GET_ACL_HANDLE_CACHE Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf Reviewed-by: Tony Hutter Reviewed-by: Tino Reichardt Signed-off-by: Rob Norris Closes #16479 --- config/kernel-acl.m4 | 28 ---------------------------- module/os/linux/zfs/zpl_xattr.c | 17 ----------------- 2 files changed, 45 deletions(-) diff --git a/config/kernel-acl.m4 b/config/kernel-acl.m4 index b1da74173..e53b546af 100644 --- a/config/kernel-acl.m4 +++ b/config/kernel-acl.m4 @@ -199,32 +199,6 @@ AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [ ]) ]) -dnl # -dnl # 4.7 API change, -dnl # The kernel get_acl will now check cache before calling i_op->get_acl and -dnl # do set_cached_acl after that, so i_op->get_acl don't need to do that -dnl # anymore. -dnl # -AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE], [ - ZFS_LINUX_TEST_SRC([get_acl_handle_cache], [ - #include - ],[ - void *sentinel __attribute__ ((unused)) = - uncached_acl_sentinel(NULL); - ]) -]) - -AC_DEFUN([ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE], [ - AC_MSG_CHECKING([whether uncached_acl_sentinel() exists]) - ZFS_LINUX_TEST_RESULT([get_acl_handle_cache], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_KERNEL_GET_ACL_HANDLE_CACHE, 1, - [uncached_acl_sentinel() exists]) - ],[ - AC_MSG_RESULT(no) - ]) -]) - dnl # dnl # 4.16 kernel: check if struct posix_acl acl.a_refcount is a refcount_t. dnl # It's an atomic_t on older kernels. @@ -255,7 +229,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_ACL], [ ZFS_AC_KERNEL_SRC_POSIX_ACL_VALID_WITH_NS ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_GET_ACL ZFS_AC_KERNEL_SRC_INODE_OPERATIONS_SET_ACL - ZFS_AC_KERNEL_SRC_GET_ACL_HANDLE_CACHE ZFS_AC_KERNEL_SRC_ACL_HAS_REFCOUNT ]) @@ -264,6 +237,5 @@ AC_DEFUN([ZFS_AC_KERNEL_ACL], [ ZFS_AC_KERNEL_POSIX_ACL_VALID_WITH_NS ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL - ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE ZFS_AC_KERNEL_ACL_HAS_REFCOUNT ]) diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c index beca5b655..f272054e0 100644 --- a/module/os/linux/zfs/zpl_xattr.c +++ b/module/os/linux/zfs/zpl_xattr.c @@ -1087,17 +1087,6 @@ zpl_get_acl_impl(struct inode *ip, int type) void *value = NULL; char *name; - /* - * As of Linux 3.14, the kernel get_acl will check this for us. - * Also as of Linux 4.7, comparing against ACL_NOT_CACHED is wrong - * as the kernel get_acl will set it to temporary sentinel value. - */ -#ifndef HAVE_KERNEL_GET_ACL_HANDLE_CACHE - acl = get_cached_acl(ip, type); - if (acl != ACL_NOT_CACHED) - return (acl); -#endif - switch (type) { case ACL_TYPE_ACCESS: name = XATTR_NAME_POSIX_ACL_ACCESS; @@ -1126,12 +1115,6 @@ zpl_get_acl_impl(struct inode *ip, int type) if (size > 0) kmem_free(value, size); - /* As of Linux 4.7, the kernel get_acl will set this for us */ -#ifndef HAVE_KERNEL_GET_ACL_HANDLE_CACHE - if (!IS_ERR(acl)) - set_cached_acl(ip, type, acl); -#endif - return (acl); }