[LU-10371] Kernel >= 4.8 has no posix_acl_xattr_entry a_entries[0] Created: 12/Dec/17 Updated: 08/Jan/18 Resolved: 22/Dec/17 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.10.1 |
| Fix Version/s: | Lustre 2.11.0, Lustre 2.10.3 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Thomas Stibor | Assignee: | Thomas Stibor |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | patch | ||
| Environment: |
Debian 9 Stretch (4.9.65-3) |
||
| Epic/Theme: | patch |
| Severity: | 3 |
| Rank (Obsolete): | 9223372036854775807 |
| Description |
|
Compiling on Kernel >= 4.8 results in error error: ‘struct posix_acl_xattr_header’ has no member named ‘a_entries’ due to Linux Kernel commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621 ...
-typedef struct {
+struct posix_acl_xattr_header {
__le32 a_version;
- posix_acl_xattr_entry a_entries[0];
-} posix_acl_xattr_header;
+};
...
where the a_entries[0] was removed. There exists in already a check for this structure # # LC_STRUCT_POSIX_ACL_XATTR # # Kernel version 4.8 commit 2211d5ba5c6c4e972ba6dbc912b2897425ea6621 # posix_acl: xattr representation cleanups # AC_DEFUN([LC_STRUCT_POSIX_ACL_XATTR], [ LB_CHECK_COMPILE([if 'struct posix_acl_xattr_{header,entry}' defined], struct_posix_acl_xattr, [ #include <linux/fs.h> #include <linux/posix_acl_xattr.h> ],[ struct posix_acl_xattr_header *h = NULL; struct posix_acl_xattr_entry *e; e = (void *)(h + 1); ],[ AC_DEFINE(HAVE_STRUCT_POSIX_ACL_XATTR, 1, [struct posix_acl_xattr_{header,entry} defined]) ]) ]) # LC_STRUCT_POSIX_ACL_XATTR so let's use the check for fixing it e.g. as follows: diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c
index 40e3d55..01a5220 100644
--- a/lustre/ptlrpc/wiretest.c
+++ b/lustre/ptlrpc/wiretest.c
@@ -4548,10 +4548,12 @@ void lustre_assert_wire_constants(void)
(long long)(int)offsetof(posix_acl_xattr_header, a_version));
LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_version) == 4, "found %lld\n",
(long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_version));
+#ifndef HAVE_STRUCT_POSIX_ACL_XATTR
LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4, "found %lld\n",
(long long)(int)offsetof(posix_acl_xattr_header, a_entries));
LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0, "found %lld\n",
(long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_entries));
+#endif /* HAVE_STRUCT_POSIX_ACL_XATTR */
#endif /* CONFIG_FS_POSIX_ACL */
|
| Comments |
| Comment by Gerrit Updater [ 12/Dec/17 ] |
|
Thomas Stibor (t.stibor@gsi.de) uploaded a new patch: https://review.whamcloud.com/30495 |
| Comment by James A Simmons [ 12/Dec/17 ] |
|
I saw they finally actually remove a_entries in kernel 4.13 |
| Comment by Gerrit Updater [ 22/Dec/17 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/30495/ |
| Comment by Peter Jones [ 22/Dec/17 ] |
|
Landed for 2.11 |
| Comment by Gerrit Updater [ 02/Jan/18 ] |
|
Minh Diep (minh.diep@intel.com) uploaded a new patch: https://review.whamcloud.com/30691 |
| Comment by Gerrit Updater [ 08/Jan/18 ] |
|
John L. Hammond (john.hammond@intel.com) merged in patch https://review.whamcloud.com/30691/ |