Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux 4.5 compat #4228

Closed
wants to merge 3 commits into from
Closed

Conversation

behlendorf
Copy link
Contributor

Add support for Linux 4.5 kernels. To summerize:

  • iops->follow_link() replaced by .get_link() with slightly different behavior.
  • xattr_handler->list() simplified.

These changes have been lightly tested for 3.10 and the latest kernel.org kernel. Due to the significant cleanup of the autoconf code I expect the buildbot will uncover at least one build issue for a specific kernel.

@kernelOfTruth
Copy link
Contributor

FYI:

got the following compilation error on my current WIP-branch:
https://github.com/kernelOfTruth/zfs/commits/tuxoko_zfs/abd_next_16.01.2016%2BIllumos-4950-2605%2B4.5-kernel

running kernel is 4.4.0

In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c: In function ‘zpl_xattr_user_list’:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:6: error: ‘list_list_size’ undeclared (first use in this function)
      list_list_size, name, name_len));    \
      ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:683:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_user_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:6: note: each undeclared identifier is reported only once for each function it appears in
      list_list_size, name, name_len));    \
      ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:683:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_user_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:22: warning: passing argument 3 of ‘__zpl_xattr_user_list’ makes integer from pointer without a cast
      list_list_size, name, name_len));    \
                      ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:683:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_user_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:678:1: note: expected ‘size_t’ but argument is of type ‘const char *’
 __zpl_xattr_user_list(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:28: warning: passing argument 4 of ‘__zpl_xattr_user_list’ makes pointer from integer without a cast
      list_list_size, name, name_len));    \
                            ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:683:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_user_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:678:1: note: expected ‘const char *’ but argument is of type ‘size_t’
 __zpl_xattr_user_list(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:88:10: error: too few arguments to function ‘__zpl_xattr_user_list’
  return (__ ## fn(dentry->d_inode,    \
          ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:683:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_user_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:678:1: note: declared here
 __zpl_xattr_user_list(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c: In function ‘zpl_xattr_trusted_list’:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:6: error: ‘list_list_size’ undeclared (first use in this function)
      list_list_size, name, name_len));    \
      ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:750:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_trusted_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:22: warning: passing argument 3 of ‘__zpl_xattr_trusted_list’ makes integer from pointer without a cast
      list_list_size, name, name_len));    \
                      ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:750:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_trusted_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:745:1: note: expected ‘size_t’ but argument is of type ‘const char *’
 __zpl_xattr_trusted_list(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:28: warning: passing argument 4 of ‘__zpl_xattr_trusted_list’ makes pointer from integer without a cast
      list_list_size, name, name_len));    \
                            ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:750:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_trusted_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:745:1: note: expected ‘const char *’ but argument is of type ‘size_t’
 __zpl_xattr_trusted_list(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:88:10: error: too few arguments to function ‘__zpl_xattr_trusted_list’
  return (__ ## fn(dentry->d_inode,    \
          ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:750:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_trusted_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:745:1: note: declared here
 __zpl_xattr_trusted_list(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c: In function ‘zpl_xattr_security_list’:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:6: error: ‘list_list_size’ undeclared (first use in this function)
      list_list_size, name, name_len));    \
      ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:820:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_security_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:22: warning: passing argument 3 of ‘__zpl_xattr_security_list’ makes integer from pointer without a cast
      list_list_size, name, name_len));    \
                      ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:820:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_security_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:815:1: note: expected ‘size_t’ but argument is of type ‘const char *’
 __zpl_xattr_security_list(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:28: warning: passing argument 4 of ‘__zpl_xattr_security_list’ makes pointer from integer without a cast
      list_list_size, name, name_len));    \
                            ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:820:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_security_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:815:1: note: expected ‘const char *’ but argument is of type ‘size_t’
 __zpl_xattr_security_list(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:88:10: error: too few arguments to function ‘__zpl_xattr_security_list’
  return (__ ## fn(dentry->d_inode,    \
          ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:820:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_security_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:815:1: note: declared here
 __zpl_xattr_security_list(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c: In function ‘zpl_xattr_acl_list_access’:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:6: error: ‘list_list_size’ undeclared (first use in this function)
      list_list_size, name, name_len));    \
      ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1189:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_acl_list_access);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:22: warning: passing argument 3 of ‘__zpl_xattr_acl_list_access’ makes integer from pointer without a cast
      list_list_size, name, name_len));    \
                      ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1189:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_acl_list_access);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1175:1: note: expected ‘size_t’ but argument is of type ‘const char *’
 __zpl_xattr_acl_list_access(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:28: warning: passing argument 4 of ‘__zpl_xattr_acl_list_access’ makes pointer from integer without a cast
      list_list_size, name, name_len));    \
                            ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1189:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_acl_list_access);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1175:1: note: expected ‘const char *’ but argument is of type ‘size_t’
 __zpl_xattr_acl_list_access(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:88:10: error: too few arguments to function ‘__zpl_xattr_acl_list_access’
  return (__ ## fn(dentry->d_inode,    \
          ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1189:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_acl_list_access);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1175:1: note: declared here
 __zpl_xattr_acl_list_access(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c: In function ‘zpl_xattr_acl_list_default’:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:6: error: ‘list_list_size’ undeclared (first use in this function)
      list_list_size, name, name_len));    \
      ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1206:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_acl_list_default);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:22: warning: passing argument 3 of ‘__zpl_xattr_acl_list_default’ makes integer from pointer without a cast
      list_list_size, name, name_len));    \
                      ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1206:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_acl_list_default);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1192:1: note: expected ‘size_t’ but argument is of type ‘const char *’
 __zpl_xattr_acl_list_default(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:89:28: warning: passing argument 4 of ‘__zpl_xattr_acl_list_default’ makes pointer from integer without a cast
      list_list_size, name, name_len));    \
                            ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1206:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_acl_list_default);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1192:1: note: expected ‘const char *’ but argument is of type ‘size_t’
 __zpl_xattr_acl_list_default(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:88:10: error: too few arguments to function ‘__zpl_xattr_acl_list_default’
  return (__ ## fn(dentry->d_inode,    \
          ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1206:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_acl_list_default);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1192:1: note: declared here
 __zpl_xattr_acl_list_default(struct inode *ip, char *list, size_t list_size,
 ^
In file included from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zpl.h:39:0,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/sys/zfs_vnops.h:34,
                 from /var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:81:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c: In function ‘zpl_xattr_user_list’:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:85:48: warning: control reaches end of non-void function [-Wreturn-type]
 fn(const struct xattr_handler *handler, struct dentry *dentry,  \
                                                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:683:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_user_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c: In function ‘zpl_xattr_trusted_list’:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:85:48: warning: control reaches end of non-void function [-Wreturn-type]
 fn(const struct xattr_handler *handler, struct dentry *dentry,  \
                                                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:750:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_trusted_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c: In function ‘zpl_xattr_security_list’:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:85:48: warning: control reaches end of non-void function [-Wreturn-type]
 fn(const struct xattr_handler *handler, struct dentry *dentry,  \
                                                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:820:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_security_list);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c: In function ‘zpl_xattr_acl_list_access’:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:85:48: warning: control reaches end of non-void function [-Wreturn-type]
 fn(const struct xattr_handler *handler, struct dentry *dentry,  \
                                                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1189:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_acl_list_access);
 ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c: In function ‘zpl_xattr_acl_list_default’:
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/include/linux/xattr_compat.h:85:48: warning: control reaches end of non-void function [-Wreturn-type]
 fn(const struct xattr_handler *handler, struct dentry *dentry,  \
                                                ^
/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.c:1206:1: note: in expansion of macro ‘ZPL_XATTR_LIST_WRAPPER’
 ZPL_XATTR_LIST_WRAPPER(zpl_xattr_acl_list_default);
 ^
/usr/src/linux-4.4.0_dtop-I.2/scripts/Makefile.build:258: recipe for target '/var/tmp/portage/sys-fs/zfs-kmod-9999-r1/work/zfs-kmod-9999/module/zfs/zpl_xattr.o' failed

@kernelOfTruth
Copy link
Contributor

It's even failing when using the patches solely against latest master,

so it could be the latest changes in master causing this,

thus: opened up a buildbot testing #4238 to see if that shows anything suspicious

@behlendorf
Copy link
Contributor Author

Refreshed to fix typo in macro. That should fix the build issue for that kernel.

@kernelOfTruth
Copy link
Contributor

@behlendorf your branch compiled fine and the rebased patches, too (behlendorf_zfs/linux-4.5-compat_17.01.2016_rebase-16.01.2016)

Thanks !

@behlendorf
Copy link
Contributor Author

@dweeezil @tuxoko if either of you could review this I'd appreciate it.

@tuxoko
Copy link
Contributor

tuxoko commented Jan 18, 2016

@behlendorf
I don't understand why you have two kinds of get_link and AC test. Isn't get_link introduced in 4.5?

@behlendorf
Copy link
Contributor Author

@tuxoko there were two versions of it in. It was first introduced by commit torvalds/linux@6b25539 and then changed in commit torvalds/linux@fceef39. The good news is that only the latter should ever show up in a tagged kernel but we should handle both regardless.

I should also mention these changes are a little bigger than is strictly necessary. I took the opportunity to clean up and document the code so it's more maintainable.

@dweeezil
Copy link
Contributor

I just started looking at this and see we now have a problem introduced by torvalds/linux@34c0fd54. The pfn_t type has been converted to a single-member struct.

@behlendorf
Copy link
Contributor Author

@dweeezil man they move fast, luckily the pfn_t breakage is an easy fix. That's something we don't currently use and can just remove. I've updated the pull request accordingly and added a counterpart PR openzfs/spl#524. @tuxoko this might cause some trouble with the ABD patches since they do directly manipulate pages.

The follow_link() interface was retired in favor of get_link().
In the process of phasing in get_link() the Linux kernel went
through two different versions.  The first of which depended
on put_link() and the final version on a delayed done function.

- Improved configure checks for .follow_link, .get_link, .put_link.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.

- Both versions .get_link are detected and supported as well
  two previous versions of .follow_link.

Signed-off-by: Brian Behlendorf <[email protected]>
@behlendorf
Copy link
Contributor Author

Rebased on master and refreshed to include the security_list issue found by @tuxoko.

@dweeezil
Copy link
Contributor

I'll look this over again later. Other than the issue @tuxoko pointed out, the rest looked OK to me. I do actually want to build it, however, and in particular, examine the output of the autoconf scripts.

The registered xattr .list handler was simplified in the 4.5 kernel
to only perform a permission check.  Given a dentry for the file it
must return a boolean indicating if the name is visible.  This
differs slightly from the previous APIs which also required the
function to copy the name in to the provided list and return its
size.  That is now all the responsibility of the caller.

This should be straight forward change to make to ZoL since we've
always required the caller to make the copy.  However, this was
slightly complicated by the need to support 3 older APIs.  Yes,
between 2.6.32 and 4.5 there are 4 versions of this interface!

Therefore, while the functional change in this patch is small it
includes significant cleanup to make the code understandable and
maintainable.  These changes include:

- Improved configure checks for .list, .get, and .set interfaces.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.
  - HAVE_*_XATTR_LIST renamed HAVE_XATTR_LIST_* for consistency
    with similar iops and fops configure checks.

- POSIX_ACL_XATTR_{DEFAULT|ACCESS} were removed forcing callers to
  move to their replacements, XATTR_NAME_POSIX_ACL_{DEFAULT|ACCESS}.
  Compatibility wrapper were added for old kernels.

- ZPL_XATTR_LIST_WRAPPER added which behaves the same as the existing
  ZPL_XATTR_{GET|SET} WRAPPERs.  Only the inode is guaranteed to be
  a valid pointer, passing NULL for the 'list' and 'name' variables
  is allowed and must be checked for.  All .list functions were
  updated to use the wrapper to aid readability.

- zpl_xattr_filldir() updated to use the .list function for its
  permission check which is consistent with the updated Linux 4.5
  interface.  If a .list function is registered it should return 0
  to indicate a name should be skipped, if there is no registered
  function the name will be added.

- Additional documentation from xattr(7) describing the correct
  behavior for each namespace was added before the relevant handlers.

Signed-off-by: Brian Behlendorf <[email protected]>
The pfn_t typedef was inherited from Illumos but never directly
used by any libspl consumers.  This doesn't cause any issues in
user space but for consistency with the kernel build it has been
removed.  See torvalds/linux/commit/34c0fd54.

Signed-off-by: Brian Behlendorf <[email protected]>
Requires-spl: refs/pull/524/head
@behlendorf
Copy link
Contributor Author

Refreshed with s/xattr_hander/xattr_handler. Assuming the update version passes the buildbot and @dweeezil @tuxoko don't have any remaining issues I'd like to merge this so the kernel builders stop failing.

@tuxoko
Copy link
Contributor

tuxoko commented Jan 20, 2016

@behlendorf
This looks good to me. But personally I'd wait till rc1 comes out, just to make sure.

@dweeezil
Copy link
Contributor

@behlendorf The code LGTM. I'm still going over the autoconf tests.

@behlendorf
Copy link
Contributor Author

@dweeezil OK, just let me know when you're happy with them, I'll hold off until I hear from you. @tuxoko if they change something else before rc1 we can always address it then,

@dweeezil
Copy link
Contributor

@behlendorf All the autoconf tests LGTM.

behlendorf added a commit to behlendorf/zfs that referenced this pull request Jan 20, 2016
The follow_link() interface was retired in favor of get_link().
In the process of phasing in get_link() the Linux kernel went
through two different versions.  The first of which depended
on put_link() and the final version on a delayed done function.

- Improved configure checks for .follow_link, .get_link, .put_link.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.

- Both versions .get_link are detected and supported as well
  two previous versions of .follow_link.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
behlendorf added a commit to behlendorf/zfs that referenced this pull request Jan 20, 2016
The registered xattr .list handler was simplified in the 4.5 kernel
to only perform a permission check.  Given a dentry for the file it
must return a boolean indicating if the name is visible.  This
differs slightly from the previous APIs which also required the
function to copy the name in to the provided list and return its
size.  That is now all the responsibility of the caller.

This should be straight forward change to make to ZoL since we've
always required the caller to make the copy.  However, this was
slightly complicated by the need to support 3 older APIs.  Yes,
between 2.6.32 and 4.5 there are 4 versions of this interface!

Therefore, while the functional change in this patch is small it
includes significant cleanup to make the code understandable and
maintainable.  These changes include:

- Improved configure checks for .list, .get, and .set interfaces.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.
  - HAVE_*_XATTR_LIST renamed HAVE_XATTR_LIST_* for consistency
    with similar iops and fops configure checks.

- POSIX_ACL_XATTR_{DEFAULT|ACCESS} were removed forcing callers to
  move to their replacements, XATTR_NAME_POSIX_ACL_{DEFAULT|ACCESS}.
  Compatibility wrapper were added for old kernels.

- ZPL_XATTR_LIST_WRAPPER added which behaves the same as the existing
  ZPL_XATTR_{GET|SET} WRAPPERs.  Only the inode is guaranteed to be
  a valid pointer, passing NULL for the 'list' and 'name' variables
  is allowed and must be checked for.  All .list functions were
  updated to use the wrapper to aid readability.

- zpl_xattr_filldir() updated to use the .list function for its
  permission check which is consistent with the updated Linux 4.5
  interface.  If a .list function is registered it should return 0
  to indicate a name should be skipped, if there is no registered
  function the name will be added.

- Additional documentation from xattr(7) describing the correct
  behavior for each namespace was added before the relevant handlers.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
behlendorf added a commit to behlendorf/zfs that referenced this pull request Jan 20, 2016
The pfn_t typedef was inherited from Illumos but never directly
used by any libspl consumers.  This doesn't cause any issues in
user space but for consistency with the kernel build it has been
removed.  See torvalds/linux/commit/34c0fd54.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
@behlendorf
Copy link
Contributor Author

Thanks guys, merged as:

openzfs/spl@de77e24 Linux 4.5 compat: pfn_t typedef
ae3a373 Linux 4.5 compat: pfn_t typedef
4967a3e Linux 4.5 compat: xattr list handler
beeed45 Linux 4.5 compat: get_link() / put_link()

@behlendorf behlendorf closed this Jan 20, 2016
behlendorf added a commit that referenced this pull request Jan 29, 2016
The follow_link() interface was retired in favor of get_link().
In the process of phasing in get_link() the Linux kernel went
through two different versions.  The first of which depended
on put_link() and the final version on a delayed done function.

- Improved configure checks for .follow_link, .get_link, .put_link.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.

- Both versions .get_link are detected and supported as well
  two previous versions of .follow_link.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue #4228
behlendorf added a commit that referenced this pull request Jan 29, 2016
The registered xattr .list handler was simplified in the 4.5 kernel
to only perform a permission check.  Given a dentry for the file it
must return a boolean indicating if the name is visible.  This
differs slightly from the previous APIs which also required the
function to copy the name in to the provided list and return its
size.  That is now all the responsibility of the caller.

This should be straight forward change to make to ZoL since we've
always required the caller to make the copy.  However, this was
slightly complicated by the need to support 3 older APIs.  Yes,
between 2.6.32 and 4.5 there are 4 versions of this interface!

Therefore, while the functional change in this patch is small it
includes significant cleanup to make the code understandable and
maintainable.  These changes include:

- Improved configure checks for .list, .get, and .set interfaces.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.
  - HAVE_*_XATTR_LIST renamed HAVE_XATTR_LIST_* for consistency
    with similar iops and fops configure checks.

- POSIX_ACL_XATTR_{DEFAULT|ACCESS} were removed forcing callers to
  move to their replacements, XATTR_NAME_POSIX_ACL_{DEFAULT|ACCESS}.
  Compatibility wrapper were added for old kernels.

- ZPL_XATTR_LIST_WRAPPER added which behaves the same as the existing
  ZPL_XATTR_{GET|SET} WRAPPERs.  Only the inode is guaranteed to be
  a valid pointer, passing NULL for the 'list' and 'name' variables
  is allowed and must be checked for.  All .list functions were
  updated to use the wrapper to aid readability.

- zpl_xattr_filldir() updated to use the .list function for its
  permission check which is consistent with the updated Linux 4.5
  interface.  If a .list function is registered it should return 0
  to indicate a name should be skipped, if there is no registered
  function the name will be added.

- Additional documentation from xattr(7) describing the correct
  behavior for each namespace was added before the relevant handlers.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue #4228
behlendorf added a commit that referenced this pull request Jan 29, 2016
The pfn_t typedef was inherited from Illumos but never directly
used by any libspl consumers.  This doesn't cause any issues in
user space but for consistency with the kernel build it has been
removed.  See torvalds/linux/commit/34c0fd54.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue #4228
goulvenriou pushed a commit to Alyseo/zfs that referenced this pull request Feb 3, 2016
The follow_link() interface was retired in favor of get_link().
In the process of phasing in get_link() the Linux kernel went
through two different versions.  The first of which depended
on put_link() and the final version on a delayed done function.

- Improved configure checks for .follow_link, .get_link, .put_link.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.

- Both versions .get_link are detected and supported as well
  two previous versions of .follow_link.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
goulvenriou pushed a commit to Alyseo/zfs that referenced this pull request Feb 3, 2016
The registered xattr .list handler was simplified in the 4.5 kernel
to only perform a permission check.  Given a dentry for the file it
must return a boolean indicating if the name is visible.  This
differs slightly from the previous APIs which also required the
function to copy the name in to the provided list and return its
size.  That is now all the responsibility of the caller.

This should be straight forward change to make to ZoL since we've
always required the caller to make the copy.  However, this was
slightly complicated by the need to support 3 older APIs.  Yes,
between 2.6.32 and 4.5 there are 4 versions of this interface!

Therefore, while the functional change in this patch is small it
includes significant cleanup to make the code understandable and
maintainable.  These changes include:

- Improved configure checks for .list, .get, and .set interfaces.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.
  - HAVE_*_XATTR_LIST renamed HAVE_XATTR_LIST_* for consistency
    with similar iops and fops configure checks.

- POSIX_ACL_XATTR_{DEFAULT|ACCESS} were removed forcing callers to
  move to their replacements, XATTR_NAME_POSIX_ACL_{DEFAULT|ACCESS}.
  Compatibility wrapper were added for old kernels.

- ZPL_XATTR_LIST_WRAPPER added which behaves the same as the existing
  ZPL_XATTR_{GET|SET} WRAPPERs.  Only the inode is guaranteed to be
  a valid pointer, passing NULL for the 'list' and 'name' variables
  is allowed and must be checked for.  All .list functions were
  updated to use the wrapper to aid readability.

- zpl_xattr_filldir() updated to use the .list function for its
  permission check which is consistent with the updated Linux 4.5
  interface.  If a .list function is registered it should return 0
  to indicate a name should be skipped, if there is no registered
  function the name will be added.

- Additional documentation from xattr(7) describing the correct
  behavior for each namespace was added before the relevant handlers.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
goulvenriou pushed a commit to Alyseo/zfs that referenced this pull request Feb 3, 2016
The pfn_t typedef was inherited from Illumos but never directly
used by any libspl consumers.  This doesn't cause any issues in
user space but for consistency with the kernel build it has been
removed.  See torvalds/linux/commit/34c0fd54.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
The follow_link() interface was retired in favor of get_link().
In the process of phasing in get_link() the Linux kernel went
through two different versions.  The first of which depended
on put_link() and the final version on a delayed done function.

- Improved configure checks for .follow_link, .get_link, .put_link.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.

- Both versions .get_link are detected and supported as well
  two previous versions of .follow_link.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
The registered xattr .list handler was simplified in the 4.5 kernel
to only perform a permission check.  Given a dentry for the file it
must return a boolean indicating if the name is visible.  This
differs slightly from the previous APIs which also required the
function to copy the name in to the provided list and return its
size.  That is now all the responsibility of the caller.

This should be straight forward change to make to ZoL since we've
always required the caller to make the copy.  However, this was
slightly complicated by the need to support 3 older APIs.  Yes,
between 2.6.32 and 4.5 there are 4 versions of this interface!

Therefore, while the functional change in this patch is small it
includes significant cleanup to make the code understandable and
maintainable.  These changes include:

- Improved configure checks for .list, .get, and .set interfaces.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.
  - HAVE_*_XATTR_LIST renamed HAVE_XATTR_LIST_* for consistency
    with similar iops and fops configure checks.

- POSIX_ACL_XATTR_{DEFAULT|ACCESS} were removed forcing callers to
  move to their replacements, XATTR_NAME_POSIX_ACL_{DEFAULT|ACCESS}.
  Compatibility wrapper were added for old kernels.

- ZPL_XATTR_LIST_WRAPPER added which behaves the same as the existing
  ZPL_XATTR_{GET|SET} WRAPPERs.  Only the inode is guaranteed to be
  a valid pointer, passing NULL for the 'list' and 'name' variables
  is allowed and must be checked for.  All .list functions were
  updated to use the wrapper to aid readability.

- zpl_xattr_filldir() updated to use the .list function for its
  permission check which is consistent with the updated Linux 4.5
  interface.  If a .list function is registered it should return 0
  to indicate a name should be skipped, if there is no registered
  function the name will be added.

- Additional documentation from xattr(7) describing the correct
  behavior for each namespace was added before the relevant handlers.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
The pfn_t typedef was inherited from Illumos but never directly
used by any libspl consumers.  This doesn't cause any issues in
user space but for consistency with the kernel build it has been
removed.  See torvalds/linux/commit/34c0fd54.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
The follow_link() interface was retired in favor of get_link().
In the process of phasing in get_link() the Linux kernel went
through two different versions.  The first of which depended
on put_link() and the final version on a delayed done function.

- Improved configure checks for .follow_link, .get_link, .put_link.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.

- Both versions .get_link are detected and supported as well
  two previous versions of .follow_link.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
The registered xattr .list handler was simplified in the 4.5 kernel
to only perform a permission check.  Given a dentry for the file it
must return a boolean indicating if the name is visible.  This
differs slightly from the previous APIs which also required the
function to copy the name in to the provided list and return its
size.  That is now all the responsibility of the caller.

This should be straight forward change to make to ZoL since we've
always required the caller to make the copy.  However, this was
slightly complicated by the need to support 3 older APIs.  Yes,
between 2.6.32 and 4.5 there are 4 versions of this interface!

Therefore, while the functional change in this patch is small it
includes significant cleanup to make the code understandable and
maintainable.  These changes include:

- Improved configure checks for .list, .get, and .set interfaces.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.
  - HAVE_*_XATTR_LIST renamed HAVE_XATTR_LIST_* for consistency
    with similar iops and fops configure checks.

- POSIX_ACL_XATTR_{DEFAULT|ACCESS} were removed forcing callers to
  move to their replacements, XATTR_NAME_POSIX_ACL_{DEFAULT|ACCESS}.
  Compatibility wrapper were added for old kernels.

- ZPL_XATTR_LIST_WRAPPER added which behaves the same as the existing
  ZPL_XATTR_{GET|SET} WRAPPERs.  Only the inode is guaranteed to be
  a valid pointer, passing NULL for the 'list' and 'name' variables
  is allowed and must be checked for.  All .list functions were
  updated to use the wrapper to aid readability.

- zpl_xattr_filldir() updated to use the .list function for its
  permission check which is consistent with the updated Linux 4.5
  interface.  If a .list function is registered it should return 0
  to indicate a name should be skipped, if there is no registered
  function the name will be added.

- Additional documentation from xattr(7) describing the correct
  behavior for each namespace was added before the relevant handlers.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
Flefebvre pushed a commit to Flefebvre/zfs that referenced this pull request Feb 3, 2016
The pfn_t typedef was inherited from Illumos but never directly
used by any libspl consumers.  This doesn't cause any issues in
user space but for consistency with the kernel build it has been
removed.  See torvalds/linux/commit/34c0fd54.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
tuxoko pushed a commit to tuxoko/zfs that referenced this pull request Feb 8, 2016
The follow_link() interface was retired in favor of get_link().
In the process of phasing in get_link() the Linux kernel went
through two different versions.  The first of which depended
on put_link() and the final version on a delayed done function.

- Improved configure checks for .follow_link, .get_link, .put_link.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.

- Both versions .get_link are detected and supported as well
  two previous versions of .follow_link.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
tuxoko pushed a commit to tuxoko/zfs that referenced this pull request Feb 8, 2016
The registered xattr .list handler was simplified in the 4.5 kernel
to only perform a permission check.  Given a dentry for the file it
must return a boolean indicating if the name is visible.  This
differs slightly from the previous APIs which also required the
function to copy the name in to the provided list and return its
size.  That is now all the responsibility of the caller.

This should be straight forward change to make to ZoL since we've
always required the caller to make the copy.  However, this was
slightly complicated by the need to support 3 older APIs.  Yes,
between 2.6.32 and 4.5 there are 4 versions of this interface!

Therefore, while the functional change in this patch is small it
includes significant cleanup to make the code understandable and
maintainable.  These changes include:

- Improved configure checks for .list, .get, and .set interfaces.
  - Interfaces checked from newest to oldest.
  - Strict checking for each possible known interface.
  - Configure fails when no known interface is available.
  - HAVE_*_XATTR_LIST renamed HAVE_XATTR_LIST_* for consistency
    with similar iops and fops configure checks.

- POSIX_ACL_XATTR_{DEFAULT|ACCESS} were removed forcing callers to
  move to their replacements, XATTR_NAME_POSIX_ACL_{DEFAULT|ACCESS}.
  Compatibility wrapper were added for old kernels.

- ZPL_XATTR_LIST_WRAPPER added which behaves the same as the existing
  ZPL_XATTR_{GET|SET} WRAPPERs.  Only the inode is guaranteed to be
  a valid pointer, passing NULL for the 'list' and 'name' variables
  is allowed and must be checked for.  All .list functions were
  updated to use the wrapper to aid readability.

- zpl_xattr_filldir() updated to use the .list function for its
  permission check which is consistent with the updated Linux 4.5
  interface.  If a .list function is registered it should return 0
  to indicate a name should be skipped, if there is no registered
  function the name will be added.

- Additional documentation from xattr(7) describing the correct
  behavior for each namespace was added before the relevant handlers.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
tuxoko pushed a commit to tuxoko/zfs that referenced this pull request Feb 8, 2016
The pfn_t typedef was inherited from Illumos but never directly
used by any libspl consumers.  This doesn't cause any issues in
user space but for consistency with the kernel build it has been
removed.  See torvalds/linux/commit/34c0fd54.

Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Chunwei Chen <[email protected]>
Issue openzfs#4228
@behlendorf behlendorf added this to the 0.6.5.5 milestone Mar 23, 2016
@behlendorf behlendorf deleted the linux-4.5-compat branch May 1, 2017 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants