[LU-12937] make newwiretest adds strings, not connected to changes Created: 05/Nov/19  Updated: 14/Dec/19  Resolved: 14/Dec/19

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

Type: Bug Priority: Major
Reporter: Artem Blagodarenko (Inactive) Assignee: Andreas Dilger
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

I was trying to generate wiretest.c for my changes and noticed unexpected strings in diff. This stings are generated even on clean master. 

 diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c
index 3056a0bb7c..2fa38ed51a 100644
--- a/lustre/ptlrpc/wiretest.c
+++ b/lustre/ptlrpc/wiretest.c
@@ -175,8 +175,6 @@ void lustre_assert_wire_constants(void)
                 (long long)MDS_HSM_CT_UNREGISTER);
        LASSERTF(MDS_SWAP_LAYOUTS == 61, "found %lld\n",
                 (long long)MDS_SWAP_LAYOUTS);
-       LASSERTF(MDS_RMFID == 62, "found %lld\n",
-                (long long)MDS_RMFID);
        LASSERTF(MDS_LAST_OPC == 63, "found %lld\n",
                 (long long)MDS_LAST_OPC);
        LASSERTF(REINT_SETATTR == 1, "found %lld\n",
@@ -1343,8 +1341,6 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT2_LOCK_CONVERT);
        LASSERTF(OBD_CONNECT2_ARCHIVE_ID_ARRAY == 0x100ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_ARCHIVE_ID_ARRAY);
-       LASSERTF(OBD_CONNECT2_INC_XID == 0x200ULL, "found 0x%.16llxULL\n",
-                OBD_CONNECT2_INC_XID);
        LASSERTF(OBD_CONNECT2_SELINUX_POLICY == 0x400ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_SELINUX_POLICY);
        LASSERTF(OBD_CONNECT2_LSOM == 0x800ULL, "found 0x%.16llxULL\n",
@@ -1948,20 +1944,6 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct obd_statfs, os_spare9));
        LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare9) == 4, "found %lld\n",
                 (long long)(int)sizeof(((struct obd_statfs *)0)->os_spare9));
-       LASSERTF(OS_STATE_DEGRADED == 0x1, "found %lld\n",
-                (long long)OS_STATE_DEGRADED);
-       LASSERTF(OS_STATE_READONLY == 0x2, "found %lld\n",
-                (long long)OS_STATE_READONLY);
-       LASSERTF(OS_STATE_NOPRECREATE == 0x4, "found %lld\n",
-                (long long)OS_STATE_NOPRECREATE);
-       LASSERTF(OS_STATE_ENOSPC == 0x20, "found %lld\n",
-                (long long)OS_STATE_ENOSPC);
-       LASSERTF(OS_STATE_ENOINO == 0x40, "found %lld\n",
-                (long long)OS_STATE_ENOINO);
-       LASSERTF(OS_STATE_SUM == 0x100, "found %lld\n",
-                (long long)OS_STATE_SUM);
-       LASSERTF(OS_STATE_NONROT == 0x200, "found %lld\n",
-                (long long)OS_STATE_NONROT);
 
        /* Checks for struct obd_ioobj */
        LASSERTF((int)sizeof(struct obd_ioobj) == 24, "found %lld\n",
@@ -2518,19 +2500,19 @@ void lustre_assert_wire_constants(void)
                (unsigned)LUSTRE_DIRECTIO_FL);
        LASSERTF(LUSTRE_INLINE_DATA_FL == 0x10000000UL, "found 0x%.8xUL\n",
                (unsigned)LUSTRE_INLINE_DATA_FL);
-       LASSERTF(MDS_INODELOCK_LOOKUP == 0x000001, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_LOOKUP == MDS_INODELOCK_LOOKUP, "found 0x%.8x\n",
                MDS_INODELOCK_LOOKUP);
-       LASSERTF(MDS_INODELOCK_UPDATE == 0x000002, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_UPDATE == MDS_INODELOCK_UPDATE, "found 0x%.8x\n",
                MDS_INODELOCK_UPDATE);
-       LASSERTF(MDS_INODELOCK_OPEN == 0x000004, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_OPEN == MDS_INODELOCK_OPEN, "found 0x%.8x\n",
                MDS_INODELOCK_OPEN);
-       LASSERTF(MDS_INODELOCK_LAYOUT == 0x000008, "found 0x%.8x\n",
                MDS_INODELOCK_LAYOUT);
-       LASSERTF(MDS_INODELOCK_PERM == 0x000010, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_PERM == MDS_INODELOCK_PERM, "found 0x%.8x\n",
                MDS_INODELOCK_PERM);
-       LASSERTF(MDS_INODELOCK_XATTR == 0x000020, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_XATTR == MDS_INODELOCK_XATTR, "found 0x%.8x\n",
                MDS_INODELOCK_XATTR);
-       LASSERTF(MDS_INODELOCK_DOM == 0x000040, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_DOM == MDS_INODELOCK_DOM, "found 0x%.8x\n",
                MDS_INODELOCK_DOM);
 
        /* Checks for struct mdt_ioepoch */
@@ -4629,7 +4611,7 @@ void lustre_assert_wire_constants(void)
        CLASSERT(FIEMAP_EXTENT_NO_DIRECT == 0x40000000);
        CLASSERT(FIEMAP_EXTENT_NET == 0x80000000);
 
-#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
+#ifdef CONFIG_FS_POSIX_ACL
        /* Checks for type posix_acl_xattr_entry */
        LASSERTF((int)sizeof(posix_acl_xattr_entry) == 8, "found %lld\n",
                 (long long)(int)sizeof(posix_acl_xattr_entry));
@@ -4645,9 +4627,9 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(posix_acl_xattr_entry, e_id));
        LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_id) == 4, "found %lld\n",
                 (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_id));
-#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
+#endif /* CONFIG_FS_POSIX_ACL */
 
-#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
+#ifdef CONFIG_FS_POSIX_ACL
        /* Checks for type posix_acl_xattr_header */
        LASSERTF((int)sizeof(posix_acl_xattr_header) == 4, "found %lld\n",
                 (long long)(int)sizeof(posix_acl_xattr_header));
@@ -4661,7 +4643,7 @@ void lustre_assert_wire_constants(void)
        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_LUSTRE_FS_POSIX_ACL */
+#endif /* CONFIG_FS_POSIX_ACL */
 
        /* Checks for struct link_ea_header */
        LASSERTF((int)sizeof(struct link_ea_header) == 24, "found %lld\n",
diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c
index 68b6691e31..ac79a96062 100644
--- a/lustre/utils/wiretest.c
+++ b/lustre/utils/wiretest.c
@@ -196,8 +196,6 @@ void lustre_assert_wire_constants(void)
                 (long long)MDS_HSM_CT_UNREGISTER);
        LASSERTF(MDS_SWAP_LAYOUTS == 61, "found %lld\n",
                 (long long)MDS_SWAP_LAYOUTS);
-       LASSERTF(MDS_RMFID == 62, "found %lld\n",
-                (long long)MDS_RMFID);
        LASSERTF(MDS_LAST_OPC == 63, "found %lld\n",
                 (long long)MDS_LAST_OPC);
        LASSERTF(REINT_SETATTR == 1, "found %lld\n",
@@ -1364,8 +1362,6 @@ void lustre_assert_wire_constants(void)
                 OBD_CONNECT2_LOCK_CONVERT);
        LASSERTF(OBD_CONNECT2_ARCHIVE_ID_ARRAY == 0x100ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_ARCHIVE_ID_ARRAY);
-       LASSERTF(OBD_CONNECT2_INC_XID == 0x200ULL, "found 0x%.16llxULL\n",
-                OBD_CONNECT2_INC_XID);
        LASSERTF(OBD_CONNECT2_SELINUX_POLICY == 0x400ULL, "found 0x%.16llxULL\n",
                 OBD_CONNECT2_SELINUX_POLICY);
        LASSERTF(OBD_CONNECT2_LSOM == 0x800ULL, "found 0x%.16llxULL\n",
@@ -2525,19 +2521,19 @@ void lustre_assert_wire_constants(void)
                (unsigned)LUSTRE_DIRECTIO_FL);
        LASSERTF(LUSTRE_INLINE_DATA_FL == 0x10000000UL, "found 0x%.8xUL\n",
                (unsigned)LUSTRE_INLINE_DATA_FL);
-       LASSERTF(MDS_INODELOCK_LOOKUP == 0x000001, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_LOOKUP == MDS_INODELOCK_LOOKUP, "found 0x%.8x\n",
                MDS_INODELOCK_LOOKUP);
-       LASSERTF(MDS_INODELOCK_UPDATE == 0x000002, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_UPDATE == MDS_INODELOCK_UPDATE, "found 0x%.8x\n",
                MDS_INODELOCK_UPDATE);
-       LASSERTF(MDS_INODELOCK_OPEN == 0x000004, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_OPEN == MDS_INODELOCK_OPEN, "found 0x%.8x\n",
                MDS_INODELOCK_OPEN);
-       LASSERTF(MDS_INODELOCK_LAYOUT == 0x000008, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_LAYOUT == MDS_INODELOCK_LAYOUT, "found 0x%.8x\n",
                MDS_INODELOCK_LAYOUT);
-       LASSERTF(MDS_INODELOCK_PERM == 0x000010, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_PERM == MDS_INODELOCK_PERM, "found 0x%.8x\n",
                MDS_INODELOCK_PERM);
-       LASSERTF(MDS_INODELOCK_XATTR == 0x000020, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_XATTR == MDS_INODELOCK_XATTR, "found 0x%.8x\n",
                MDS_INODELOCK_XATTR);
-       LASSERTF(MDS_INODELOCK_DOM == 0x000040, "found 0x%.8x\n",
+       LASSERTF(MDS_INODELOCK_DOM == MDS_INODELOCK_DOM, "found 0x%.8x\n",
                MDS_INODELOCK_DOM);
 
        /* Checks for struct mdt_ioepoch */

I expect make newwiretest should not change anything if requests-related code is not changed.



 Comments   
Comment by Artem Blagodarenko (Inactive) [ 05/Nov/19 ]

It looks like check_* macroses can not work with enums, but enums were added in this patch:

commit 3611352b699ce479779c0ff92ca558d9321e58a2
Author: Andreas Dilger <adilger@whamcloud.com>
Date:   Mon Jun 3 12:21:53 2019 -0600

    LU-11285 mdt: improve IBITS lock definitions
    
    Move MDS_INODELOCK_* flags into a named enum, and add the definitions
    for the newer flags into wirecheck/wiretest to ensure consistency.
    
    Rename MDS_INODELOCK_MAXSHIFT to MDS_INODELOCK_NUMBITS to hold current
    number of lockbits, rather than one less than the number of lockbits,
    since the only two places that use it expect it to be one larger than
    it is.  Fix uses of MDS_INODELOCK_NUMBITS to be number of locks.  This
    does not change the value of MDS_INODELOCK_FULL, which is used in the
    protocol to exchange supported lock bits between client and server.
    
    Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
    Change-Id: I0c2985bcc602b7182d5db2cf8d590923be2cab07
    Reviewed-on: https://review.whamcloud.com/35045
    Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
    Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
    Tested-by: jenkins <devops@whamcloud.com>
    Tested-by: Maloo <maloo@whamcloud.com>
    Reviewed-by: Oleg Drokin <green@whamcloud.com>
Comment by Andreas Dilger [ 07/Nov/19 ]

I thought I had fixed this as part of the patch, but I seem to have lost the changes to wirecheck.c that handle this. It needs a different macro to generate the lines for MDS flags, but I don't think it is critical for 2.13.0 as nobody should be regenerating this file for new patches on that branch.

Comment by Gerrit Updater [ 07/Nov/19 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36706
Subject: LU-12937 utils: update wirecheck for new values
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: a8d73e2b793a83627ccb4c2364d1cdb1041fdb18

Comment by Artem Blagodarenko (Inactive) [ 07/Nov/19 ]

I get compilation error with patch above:

wiretest.c: In function ‘lustre_assert_wire_constants’:
wiretest.c:4655:23: error: ‘posix_acl_xattr_entry’ undeclared (first use in this function)
  LASSERTF((int)sizeof(posix_acl_xattr_entry) == 8, "found %lld\n",
                       ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
depbase=`echo nidlist.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I../..   -include /lustre/mnt/orig/lustre-wc.git/undef.h -include /lustre/mnt/orig/lustre-wc.git/config.h -I/lustre/mnt/orig/lustre-wc.git/libcfs/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include/uapi -I/lustre/mnt/orig/lustre-wc.git/lustre/include -I/lustre/mnt/orig/lustre-wc.git/lustre/include/uapi  -fPIC -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1  -g -O2 -Wall -Werror -MT nidlist.o -MD -MP -MF $depbase.Tpo -c -o nidlist.o nidlist.c &&\
mv -f $depbase.Tpo $depbase.Po
wiretest.c:4655:23: note: each undeclared identifier is reported only once for each function it appears in
  LASSERTF((int)sizeof(posix_acl_xattr_entry) == 8, "found %lld\n",
                       ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
wiretest.c:4657:25: error: expected specifier-qualifier-list before ‘posix_acl_xattr_entry’
  LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0, "found %lld\n",
                         ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
In file included from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_fiemap.h:45:0,
                 from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_user.h:63,
                 from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_idl.h:86,
                 from wiretest.c:38:
wiretest.c:4658:29: error: expected specifier-qualifier-list before ‘posix_acl_xattr_entry’
    (long long)(int)offsetof(posix_acl_xattr_entry, e_tag));
                             ^
wiretest.c:4657:2: note: in expansion of macro ‘LASSERTF’
  LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0, "found %lld\n",
  ^
wiretest.c:4659:48: error: expected expression before ‘)’ token
  LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_tag) == 2, "found %lld\n",
                                                ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
wiretest.c:4660:52: error: expected expression before ‘)’ token
    (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_tag));
                                                    ^
wiretest.c:46:85: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                                                                     ^
depbase=`echo ll_decode_filter_fid.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I../..   -include /lustre/mnt/orig/lustre-wc.git/undef.h -include /lustre/mnt/orig/lustre-wc.git/config.h -I/lustre/mnt/orig/lustre-wc.git/libcfs/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include/uapi -I/lustre/mnt/orig/lustre-wc.git/lustre/include -I/lustre/mnt/orig/lustre-wc.git/lustre/include/uapi  -fPIC -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1  -g -O2 -Wall -Werror -MT ll_decode_filter_fid.o -MD -MP -MF $depbase.Tpo -c -o ll_decode_filter_fid.o ll_decode_filter_fid.c &&\
mv -f $depbase.Tpo $depbase.Po
wiretest.c:4661:25: error: expected specifier-qualifier-list before ‘posix_acl_xattr_entry’
  LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2, "found %lld\n",
                         ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
In file included from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_fiemap.h:45:0,
                 from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_user.h:63,
                 from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_idl.h:86,
                 from wiretest.c:38:
wiretest.c:4662:29: error: expected specifier-qualifier-list before ‘posix_acl_xattr_entry’
    (long long)(int)offsetof(posix_acl_xattr_entry, e_perm));
                             ^
wiretest.c:4661:2: note: in expansion of macro ‘LASSERTF’
  LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2, "found %lld\n",
  ^
wiretest.c:4663:48: error: expected expression before ‘)’ token
  LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_perm) == 2, "found %lld\n",
                                                ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
wiretest.c:4664:52: error: expected expression before ‘)’ token
    (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_perm));
                                                    ^
wiretest.c:46:85: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                                                                     ^
wiretest.c:4665:25: error: expected specifier-qualifier-list before ‘posix_acl_xattr_entry’
  LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4, "found %lld\n",
                         ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
In file included from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_fiemap.h:45:0,
                 from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_user.h:63,
                 from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_idl.h:86,
                 from wiretest.c:38:
wiretest.c:4666:29: error: expected specifier-qualifier-list before ‘posix_acl_xattr_entry’
    (long long)(int)offsetof(posix_acl_xattr_entry, e_id));
                             ^
wiretest.c:4665:2: note: in expansion of macro ‘LASSERTF’
  LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4, "found %lld\n",
  ^
wiretest.c:4667:48: error: expected expression before ‘)’ token
  LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_id) == 4, "found %lld\n",
                                                ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
wiretest.c:4668:52: error: expected expression before ‘)’ token
    (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_id));
                                                    ^
wiretest.c:46:85: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                                                                     ^
wiretest.c:4673:23: error: ‘posix_acl_xattr_header’ undeclared (first use in this function)
  LASSERTF((int)sizeof(posix_acl_xattr_header) == 4, "found %lld\n",
                       ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
depbase=`echo llog_reader.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I../..   -include /lustre/mnt/orig/lustre-wc.git/undef.h -include /lustre/mnt/orig/lustre-wc.git/config.h -I/lustre/mnt/orig/lustre-wc.git/libcfs/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include/uapi -I/lustre/mnt/orig/lustre-wc.git/lustre/include -I/lustre/mnt/orig/lustre-wc.git/lustre/include/uapi  -fPIC -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1  -g -O2 -Wall -Werror -MT llog_reader.o -MD -MP -MF $depbase.Tpo -c -o llog_reader.o llog_reader.c &&\
mv -f $depbase.Tpo $depbase.Po
wiretest.c:4675:25: error: expected specifier-qualifier-list before ‘posix_acl_xattr_header’
  LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0, "found %lld\n",
                         ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
gcc -DHAVE_CONFIG_H -I. -I../..  -DPLUGIN_DIR=\"/usr/lib/lustre\" -include /lustre/mnt/orig/lustre-wc.git/undef.h -include /lustre/mnt/orig/lustre-wc.git/config.h -I/lustre/mnt/orig/lustre-wc.git/libcfs/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include/uapi -I/lustre/mnt/orig/lustre-wc.git/lustre/include -I/lustre/mnt/orig/lustre-wc.git/lustre/include/uapi  -fPIC -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1  -g -O2 -Wall -Werror -MT l_tunedisk-l_tunedisk.o -MD -MP -MF .deps/l_tunedisk-l_tunedisk.Tpo -c -o l_tunedisk-l_tunedisk.o `test -f 'l_tunedisk.c' || echo './'`l_tunedisk.c
In file included from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_fiemap.h:45:0,
                 from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_user.h:63,
                 from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_idl.h:86,
                 from wiretest.c:38:
wiretest.c:4676:29: error: expected specifier-qualifier-list before ‘posix_acl_xattr_header’
    (long long)(int)offsetof(posix_acl_xattr_header, a_version));
                             ^
wiretest.c:4675:2: note: in expansion of macro ‘LASSERTF’
  LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0, "found %lld\n",
  ^
wiretest.c:4677:49: error: expected expression before ‘)’ token
  LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_version) == 4, "found %lld\n",
                                                 ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
wiretest.c:4678:53: error: expected expression before ‘)’ token
    (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_version));
                                                     ^
wiretest.c:46:85: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                                                                     ^
wiretest.c:4680:25: error: expected specifier-qualifier-list before ‘posix_acl_xattr_header’
  LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4, "found %lld\n",
                         ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
In file included from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_fiemap.h:45:0,
                 from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_user.h:63,
                 from /lustre/mnt/orig/lustre-wc.git/lustre/include/uapi/linux/lustre/lustre_idl.h:86,
                 from wiretest.c:38:
wiretest.c:4681:29: error: expected specifier-qualifier-list before ‘posix_acl_xattr_header’
    (long long)(int)offsetof(posix_acl_xattr_header, a_entries));
                             ^
wiretest.c:4680:2: note: in expansion of macro ‘LASSERTF’
  LASSERTF((int)offsetof(posix_acl_xattr_header, a_entries) == 4, "found %lld\n",
  ^
gcc -DHAVE_CONFIG_H -I. -I../..  -DPLUGIN_DIR=\"/usr/lib/lustre\" -include /lustre/mnt/orig/lustre-wc.git/undef.h -include /lustre/mnt/orig/lustre-wc.git/config.h -I/lustre/mnt/orig/lustre-wc.git/libcfs/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include/uapi -I/lustre/mnt/orig/lustre-wc.git/lustre/include -I/lustre/mnt/orig/lustre-wc.git/lustre/include/uapi  -fPIC -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1  -g -O2 -Wall -Werror -MT l_tunedisk-mount_utils.o -MD -MP -MF .deps/l_tunedisk-mount_utils.Tpo -c -o l_tunedisk-mount_utils.o `test -f 'mount_utils.c' || echo './'`mount_utils.c
wiretest.c:4682:49: error: expected expression before ‘)’ token
  LASSERTF((int)sizeof(((posix_acl_xattr_header *)0)->a_entries) == 0, "found %lld\n",
                                                 ^
wiretest.c:46:40: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                        ^
wiretest.c:4683:53: error: expected expression before ‘)’ token
    (long long)(int)sizeof(((posix_acl_xattr_header *)0)->a_entries));
                                                     ^
wiretest.c:46:85: note: in definition of macro ‘LASSERTF’
 #define LASSERTF(cond, fmt, ...) if (!(cond)) { printf("failed '" #cond "'" fmt, ## __VA_ARGS__);ret = 1;}
                                                                                     ^
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../.. -include /lustre/mnt/orig/lustre-wc.git/undef.h -include /lustre/mnt/orig/lustre-wc.git/config.h -I/lustre/mnt/orig/lustre-wc.git/libcfs/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include/uapi -I/lustre/mnt/orig/lustre-wc.git/lustre/include -I/lustre/mnt/orig/lustre-wc.git/lustre/include/uapi -fPIC -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1 -g -O2 -Wall -Werror -MT liblustreapi.lo -MD -MP -MF .deps/liblustreapi.Tpo -c liblustreapi.c -o liblustreapi.o >/dev/null 2>&1
mv -f .deps/mkfs_lustre-mkfs_lustre.Tpo .deps/mkfs_lustre-mkfs_lustre.Po
mv -f .deps/mkfs_lustre-mount_utils.Tpo .deps/mkfs_lustre-mount_utils.Po
depbase=`echo lhsmtool_posix.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I../..   -include /lustre/mnt/orig/lustre-wc.git/undef.h -include /lustre/mnt/orig/lustre-wc.git/config.h -I/lustre/mnt/orig/lustre-wc.git/libcfs/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include -I/lustre/mnt/orig/lustre-wc.git/lnet/include/uapi -I/lustre/mnt/orig/lustre-wc.git/lustre/include -I/lustre/mnt/orig/lustre-wc.git/lustre/include/uapi  -fPIC -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1  -g -O2 -Wall -Werror -MT lhsmtool_posix.o -MD -MP -MF $depbase.Tpo -c -o lhsmtool_posix.o lhsmtool_posix.c &&\
mv -f $depbase.Tpo $depbase.Po
make[4]: *** [wiretest.o] Error 1
make[4]: *** Waiting for unfinished jobs....
mv -f .deps/tunefs_lustre-mkfs_lustre.Tpo .deps/tunefs_lustre-mkfs_lustre.Po
mv -f .deps/l_tunedisk-l_tunedisk.Tpo .deps/l_tunedisk-l_tunedisk.Po
mv -f .deps/tunefs_lustre-mount_utils.Tpo .deps/tunefs_lustre-mount_utils.Po
mv -f .deps/l_tunedisk-mount_utils.Tpo .deps/l_tunedisk-mount_utils.Po
make[4]: Leaving directory `/lustre/mnt/orig/lustre-wc.git/lustre/utils'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/lustre/mnt/orig/lustre-wc.git/lustre/utils'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/lustre/mnt/orig/lustre-wc.git/lustre'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/lustre/mnt/orig/lustre-wc.git'
make: *** [all] Error 2
Comment by Andreas Dilger [ 08/Nov/19 ]

I get compilation error with patch above:

Sure, it is not ready for review yet. It worked on my local system, but doesn't build on all the distros. Newer kernels use "struct posix_acl_xattr_entry". The posix_acl_xattr_entry handling is really kind of a mess.

It would probably be better if we just added our own version of this struct and use the existing checks in wiretest.c to ensure the structure doesn't change.

Comment by Gerrit Updater [ 14/Dec/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36706/
Subject: LU-12937 utils: update wirecheck for new values
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: bc2e23e1cd8051d6730bd44c447b20b811ade8c4

Comment by Peter Jones [ 14/Dec/19 ]

Landed for 2.14

Generated at Sat Feb 10 02:56:57 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.