[LU-16364] lustre w/zfs 2.1.7 build fails with d_u.d_alias conflict Created: 02/Dec/22  Updated: 13/Dec/22  Resolved: 13/Dec/22

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Bug Priority: Minor
Reporter: Shaun Tancheff Assignee: Shaun Tancheff
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

d_u.d_alias is only needed in llite so move the ifdef to llite_internal.h from lustre_compat.h to avoid the build failure.

Build failure:

In file included from include/linux/kernel.h:11,
                 from /tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/libcfs/include/libcfs/libcfs.h:35,
                 from /tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/lustre/osd-zfs/osd_handler.c:41:
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h: In function 'zpl_d_drop_aliases':
/tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/lustre/include/lustre_compat.h:79:19: error: 'union <anonymous>' has no member named 'd_u'; did you mean 'd_rcu'?
 #define d_alias   d_u.d_alias
                   ^~~
include/linux/compiler.h:415:19: note: in definition of macro '__compiletime_assert'
   bool __cond = !(condition);    \
                   ^~~~~~~~~
include/linux/compiler.h:438:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:995:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
  ^~~~~~~~~~~~~~~~
include/linux/kernel.h:995:20: note: in expansion of macro '__same_type'
  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                    ^~~~~~~~~~~
include/linux/list.h:866:40: note: in expansion of macro 'container_of'
 #define hlist_entry(ptr, type, member) container_of(ptr,type,member)
                                        ^~~~~~~~~~~~
include/linux/list.h:877:15: note: in expansion of macro 'hlist_entry'
     ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^~~~~~~~~~~
include/linux/list.h:887:13: note: in expansion of macro 'hlist_entry_safe'
  for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
             ^~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:2: note: in expansion of macro 'hlist_for_each_entry'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
  ^~~~~~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:53: note: in expansion of macro 'd_alias'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
                                                     ^~~~~~~
In file included from ././include/linux/compiler_types.h:58,
                 from <command-line>:
/tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/lustre/include/lustre_compat.h:79:19: error: 'union <anonymous>' has no member named 'd_u'; did you mean 'd_rcu'?
 #define d_alias   d_u.d_alias
                   ^~~
include/linux/compiler-gcc.h:185:24: note: in definition of macro '__compiler_offsetof'
  __builtin_offsetof(a, b)
                        ^
include/linux/kernel.h:998:21: note: in expansion of macro 'offsetof'
  ((type *)(__mptr - offsetof(type, member))); })
                     ^~~~~~~~
include/linux/list.h:866:40: note: in expansion of macro 'container_of'
 #define hlist_entry(ptr, type, member) container_of(ptr,type,member)
                                        ^~~~~~~~~~~~
include/linux/list.h:877:15: note: in expansion of macro 'hlist_entry'
     ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^~~~~~~~~~~
include/linux/list.h:887:13: note: in expansion of macro 'hlist_entry_safe'
  for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
             ^~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:2: note: in expansion of macro 'hlist_for_each_entry'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
  ^~~~~~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:53: note: in expansion of macro 'd_alias'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
                                                     ^~~~~~~
In file included from include/linux/module.h:9,
                 from /tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/libcfs/include/libcfs/libcfs.h:36,
                 from /tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/lustre/osd-zfs/osd_handler.c:41:
/tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/lustre/include/lustre_compat.h:79:19: error: 'union <anonymous>' has no member named 'd_u'; did you mean 'd_rcu'?
 #define d_alias   d_u.d_alias
                   ^~~
include/linux/list.h:876:12: note: in definition of macro 'hlist_entry_safe'
  ({ typeof(ptr) ____ptr = (ptr); \
            ^~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:2: note: in expansion of macro 'hlist_for_each_entry'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
  ^~~~~~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:53: note: in expansion of macro 'd_alias'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
                                                     ^~~~~~~
/tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/lustre/include/lustre_compat.h:79:19: error: 'union <anonymous>' has no member named 'd_u'; did you mean 'd_rcu'?
 #define d_alias   d_u.d_alias
                   ^~~
include/linux/list.h:876:28: note: in definition of macro 'hlist_entry_safe'
  ({ typeof(ptr) ____ptr = (ptr); \
                            ^~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:2: note: in expansion of macro 'hlist_for_each_entry'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
  ^~~~~~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:53: note: in expansion of macro 'd_alias'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
                                                     ^~~~~~~
In file included from /tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/libcfs/include/libcfs/libcfs.h:35,
                 from /tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/lustre/osd-zfs/osd_handler.c:41:
include/linux/kernel.h:994:17: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  void *__mptr = (void *)(ptr);     \
                 ^
include/linux/list.h:866:40: note: in expansion of macro 'container_of'
 #define hlist_entry(ptr, type, member) container_of(ptr,type,member)
                                        ^~~~~~~~~~~~
include/linux/list.h:877:15: note: in expansion of macro 'hlist_entry'
     ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^~~~~~~~~~~
include/linux/list.h:889:13: note: in expansion of macro 'hlist_entry_safe'
       pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
             ^~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:2: note: in expansion of macro 'hlist_for_each_entry'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
  ^~~~~~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:11,
                 from /tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/libcfs/include/libcfs/libcfs.h:35,
                 from /tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/lustre/osd-zfs/osd_handler.c:41:
include/linux/kernel.h:995:32: error: invalid type argument of unary '*' (have 'int')
  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                                ^~~~~~
include/linux/compiler.h:415:19: note: in definition of macro '__compiletime_assert'
   bool __cond = !(condition);    \
                   ^~~~~~~~~
include/linux/compiler.h:438:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:995:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
  ^~~~~~~~~~~~~~~~
include/linux/kernel.h:995:20: note: in expansion of macro '__same_type'
  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                    ^~~~~~~~~~~
include/linux/list.h:866:40: note: in expansion of macro 'container_of'
 #define hlist_entry(ptr, type, member) container_of(ptr,type,member)
                                        ^~~~~~~~~~~~
include/linux/list.h:877:15: note: in expansion of macro 'hlist_entry'
     ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^~~~~~~~~~~
include/linux/list.h:889:13: note: in expansion of macro 'hlist_entry_safe'
       pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
             ^~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:2: note: in expansion of macro 'hlist_for_each_entry'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
  ^~~~~~~~~~~~~~~~~~~~
/tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/lustre/include/lustre_compat.h:79:19: error: 'union <anonymous>' has no member named 'd_u'; did you mean 'd_rcu'?
 #define d_alias   d_u.d_alias
                   ^~~
include/linux/compiler.h:415:19: note: in definition of macro '__compiletime_assert'
   bool __cond = !(condition);    \
                   ^~~~~~~~~
include/linux/compiler.h:438:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:995:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
  ^~~~~~~~~~~~~~~~
include/linux/kernel.h:995:20: note: in expansion of macro '__same_type'
  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
                    ^~~~~~~~~~~
include/linux/list.h:866:40: note: in expansion of macro 'container_of'
 #define hlist_entry(ptr, type, member) container_of(ptr,type,member)
                                        ^~~~~~~~~~~~
include/linux/list.h:877:15: note: in expansion of macro 'hlist_entry'
     ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^~~~~~~~~~~
include/linux/list.h:889:13: note: in expansion of macro 'hlist_entry_safe'
       pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
             ^~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:2: note: in expansion of macro 'hlist_for_each_entry'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
  ^~~~~~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:53: note: in expansion of macro 'd_alias'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
                                                     ^~~~~~~
include/linux/kernel.h:996:18: error: invalid type argument of unary '*' (have 'int')
     !__same_type(*(ptr), void),   \
                  ^~~~~~
include/linux/compiler.h:415:19: note: in definition of macro '__compiletime_assert'
   bool __cond = !(condition);    \
                   ^~~~~~~~~
include/linux/compiler.h:438:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:995:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
  ^~~~~~~~~~~~~~~~
include/linux/kernel.h:996:6: note: in expansion of macro '__same_type'
     !__same_type(*(ptr), void),   \
      ^~~~~~~~~~~
include/linux/list.h:866:40: note: in expansion of macro 'container_of'
 #define hlist_entry(ptr, type, member) container_of(ptr,type,member)
                                        ^~~~~~~~~~~~
include/linux/list.h:877:15: note: in expansion of macro 'hlist_entry'
     ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^~~~~~~~~~~
include/linux/list.h:889:13: note: in expansion of macro 'hlist_entry_safe'
       pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
             ^~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:2: note: in expansion of macro 'hlist_for_each_entry'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
  ^~~~~~~~~~~~~~~~~~~~
In file included from ././include/linux/compiler_types.h:58,
                 from <command-line>:
/tmp/rpmbuild-lustre-shaun-tJvI6dNU/BUILD/lustre-2.15.0.3_rc2_cray_410_g1bd998f/lustre/include/lustre_compat.h:79:19: error: 'union <anonymous>' has no member named 'd_u'; did you mean 'd_rcu'?
 #define d_alias   d_u.d_alias
                   ^~~
include/linux/compiler-gcc.h:185:24: note: in definition of macro '__compiler_offsetof'
  __builtin_offsetof(a, b)
                        ^
include/linux/kernel.h:998:21: note: in expansion of macro 'offsetof'
  ((type *)(__mptr - offsetof(type, member))); })
                     ^~~~~~~~
include/linux/list.h:866:40: note: in expansion of macro 'container_of'
 #define hlist_entry(ptr, type, member) container_of(ptr,type,member)
                                        ^~~~~~~~~~~~
include/linux/list.h:877:15: note: in expansion of macro 'hlist_entry'
     ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^~~~~~~~~~~
include/linux/list.h:889:13: note: in expansion of macro 'hlist_entry_safe'
       pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
             ^~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:2: note: in expansion of macro 'hlist_for_each_entry'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
  ^~~~~~~~~~~~~~~~~~~~
/usr/src/zfs-2.1.7/include/linux/dcache_compat.h:74:53: note: in expansion of macro 'd_alias'
  hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
                                                     ^~~~~~~


 Comments   
Comment by Gerrit Updater [ 02/Dec/22 ]

"Shaun Tancheff <shaun.tancheff@hpe.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/49308
Subject: LU-16364 llite: Move d_u.d_alias compat define
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 1a09a87f9fc4e3f7ec87e84506b3659100eef109

Comment by Gerrit Updater [ 13/Dec/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/49308/
Subject: LU-16364 llite: Move d_u.d_alias compat define
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: dbedb9a5f0bdd0012e8e15379b807d313060b65a

Comment by Peter Jones [ 13/Dec/22 ]

Landed for 2.16

Generated at Sat Feb 10 03:26:23 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.