Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / ptlrpc / wiretest.c
index fa5074b..81158c8 100644 (file)
@@ -1,8 +1,62 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see [sun.com URL with a
+ * copy of GPLv2].
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Use is subject to license terms.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
+ */
+
 #define DEBUG_SUBSYSTEM S_RPC
 #ifndef __KERNEL__
 # include <liblustre.h>
 #endif
 
+#ifdef __KERNEL__
+# ifndef AUTOCONF_INCLUDED
+#  include <linux/config.h>
+# endif
+# ifdef CONFIG_FS_POSIX_ACL
+#  include <linux/fs.h>
+#  ifdef HAVE_XATTR_ACL
+#   include <linux/xattr_acl.h>
+#  else
+#   define xattr_acl_entry  posix_acl_xattr_entry
+#   define xattr_acl_header posix_acl_xattr_header
+#  endif
+#  ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
+#   include <linux/posix_acl_xattr.h>
+#  endif
+# endif
+#endif
+
 #include <obd_support.h>
 #include <obd_class.h>
 #include <lustre_net.h>
 void lustre_assert_wire_constants(void)
 {
         /* Wire protocol assertions generated by 'wirecheck'
-         * (make -C lustre/utils newwirecheck)
-         * running on Linux hideous 2.6.9-prep.qp3.5.34.4qsnet #3 Mon Aug 13 08:38:55 EEST 2007 i686 
-         * with gcc version 3.4.6 20060404 (Red Hat 3.4.6-3) */
+         * (make -C lustre/utils newwiretest)
+         * running on Linux xlab.hostel 2.6.23.15-80.fc7 #1 SMP Sun Feb 10 17:29:10 EST 2008 i686 i68
+         * with gcc version 3.4.6 20060404 (Red Hat 3.4.6-7) */
 
 
         /* Constants... */
-        LASSERTF(LUSTRE_MSG_MAGIC_V1 == 0x0BD00BD0," found %lld\n",
-                 (long long)LUSTRE_MSG_MAGIC_V1);
         LASSERTF(LUSTRE_MSG_MAGIC_V2 == 0x0BD00BD3," found %lld\n",
                  (long long)LUSTRE_MSG_MAGIC_V2);
         LASSERTF(PTLRPC_MSG_VERSION == 0x00000003," found %lld\n",
                  (long long)PTLRPC_MSG_VERSION);
+        LASSERTF(MSGHDR_AT_SUPPORT == 1, " found %lld\n",
+                 (long long)MSGHDR_AT_SUPPORT);
         LASSERTF(PTL_RPC_MSG_REQUEST == 4711, " found %lld\n",
                  (long long)PTL_RPC_MSG_REQUEST);
         LASSERTF(PTL_RPC_MSG_ERR == 4712, " found %lld\n",
@@ -125,7 +179,7 @@ void lustre_assert_wire_constants(void)
                  (long long)REINT_RENAME);
         LASSERTF(REINT_OPEN == 6, " found %lld\n",
                  (long long)REINT_OPEN);
-        LASSERTF(REINT_MAX == 7, " found %lld\n",
+        LASSERTF(REINT_MAX == 8, " found %lld\n",
                  (long long)REINT_MAX);
         LASSERTF(MGS_CONNECT == 250, " found %lld\n",
                  (long long)MGS_CONNECT);
@@ -185,6 +239,8 @@ void lustre_assert_wire_constants(void)
                  (long long)LCK_GROUP);
         LASSERTF(LCK_MAXMODE == 65, " found %lld\n",
                  (long long)LCK_MAXMODE);
+        LASSERTF(LCK_MODE_NUM == 7, " found %lld\n",
+                 (long long)LCK_MODE_NUM);
         CLASSERT(LDLM_PLAIN == 10);
         CLASSERT(LDLM_EXTENT == 11);
         CLASSERT(LDLM_FLOCK == 12);
@@ -227,62 +283,6 @@ void lustre_assert_wire_constants(void)
         LASSERTF((int)sizeof(((struct lustre_handle *)0)->cookie) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct lustre_handle *)0)->cookie));
 
-        /* Checks for struct lustre_msg_v1 */
-        LASSERTF((int)sizeof(struct lustre_msg_v1) == 64, " found %lld\n",
-                 (long long)(int)sizeof(struct lustre_msg_v1));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_handle) == 0, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_handle));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_handle) == 8, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_handle));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_magic) == 8, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_magic));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_magic) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_magic));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_type) == 12, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_type));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_type) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_type));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_version) == 16, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_version));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_version) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_version));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_opc) == 20, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_opc));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_opc) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_opc));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_last_xid) == 24, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_last_xid));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_xid) == 8, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_xid));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_last_committed) == 32, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_last_committed));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_committed) == 8, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_last_committed));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_transno) == 40, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_transno));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_transno) == 8, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_transno));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_status) == 48, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_status));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_status) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_status));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_flags) == 52, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_flags));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_flags) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_flags));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_conn_cnt) == 56, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_conn_cnt));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_conn_cnt) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_conn_cnt));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_bufcount) == 60, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_bufcount));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_bufcount) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_bufcount));
-        LASSERTF((int)offsetof(struct lustre_msg_v1, lm_buflens[0]) == 64, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v1, lm_buflens[0]));
-        LASSERTF((int)sizeof(((struct lustre_msg_v1 *)0)->lm_buflens[0]) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v1 *)0)->lm_buflens[0]));
-
         /* Checks for struct lustre_msg_v2 */
         LASSERTF((int)sizeof(struct lustre_msg_v2) == 32, " found %lld\n",
                  (long long)(int)sizeof(struct lustre_msg_v2));
@@ -302,14 +302,14 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct lustre_msg_v2, lm_repsize));
         LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_repsize) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_repsize));
-        LASSERTF((int)offsetof(struct lustre_msg_v2, lm_timeout) == 16, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v2, lm_timeout));
-        LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_timeout) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_timeout));
-        LASSERTF((int)offsetof(struct lustre_msg_v2, lm_padding_1) == 20, " found %lld\n",
-                 (long long)(int)offsetof(struct lustre_msg_v2, lm_padding_1));
-        LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_padding_1) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_padding_1));
+        LASSERTF((int)offsetof(struct lustre_msg_v2, lm_cksum) == 16, " found %lld\n",
+                 (long long)(int)offsetof(struct lustre_msg_v2, lm_cksum));
+        LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_cksum) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_cksum));
+        LASSERTF((int)offsetof(struct lustre_msg_v2, lm_flags) == 20, " found %lld\n",
+                 (long long)(int)offsetof(struct lustre_msg_v2, lm_flags));
+        LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_flags) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_flags));
         LASSERTF((int)offsetof(struct lustre_msg_v2, lm_padding_2) == 24, " found %lld\n",
                  (long long)(int)offsetof(struct lustre_msg_v2, lm_padding_2));
         LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_padding_2) == 4, " found %lld\n",
@@ -322,10 +322,9 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct lustre_msg_v2, lm_buflens[0]));
         LASSERTF((int)sizeof(((struct lustre_msg_v2 *)0)->lm_buflens[0]) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct lustre_msg_v2 *)0)->lm_buflens[0]));
-        LASSERT(offsetof(struct lustre_msg_v1, lm_magic) == offsetof(struct lustre_msg_v2, lm_magic));
 
         /* Checks for struct ptlrpc_body */
-        LASSERTF((int)sizeof(struct ptlrpc_body) == 88, " found %lld\n",
+        LASSERTF((int)sizeof(struct ptlrpc_body) == 152, " found %lld\n",
                  (long long)(int)sizeof(struct ptlrpc_body));
         LASSERTF((int)offsetof(struct ptlrpc_body, pb_handle) == 0, " found %lld\n",
                  (long long)(int)offsetof(struct ptlrpc_body, pb_handle));
@@ -375,22 +374,31 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct ptlrpc_body, pb_conn_cnt));
         LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_conn_cnt) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_conn_cnt));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_padding_1) == 68, " found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_padding_1));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_padding_1) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_padding_1));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_padding_2) == 72, " found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_padding_2));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_padding_2) == 4, " found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_padding_2));
-        LASSERTF((int)offsetof(struct ptlrpc_body, pb_slv) == 80, " found %lld\n",
-                 (long long)(int)offsetof(struct ptlrpc_body, pb_slv));
-        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_slv) == 8, " found %lld\n",
-                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_slv));
+        LASSERTF((int)offsetof(struct ptlrpc_body, pb_timeout) == 68, " found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body, pb_timeout));
+        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_timeout) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_timeout));
+        LASSERTF((int)offsetof(struct ptlrpc_body, pb_service_time) == 72, " found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body, pb_service_time));
+        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_service_time) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_service_time));
         LASSERTF((int)offsetof(struct ptlrpc_body, pb_limit) == 76, " found %lld\n",
                  (long long)(int)offsetof(struct ptlrpc_body, pb_limit));
         LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_limit) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_limit));
+        LASSERTF((int)offsetof(struct ptlrpc_body, pb_slv) == 80, " found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body, pb_slv));
+        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_slv) == 8, " found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_slv));
+        LASSERTF((int)offsetof(struct ptlrpc_body, pb_pre_versions) == 88, " found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body, pb_pre_versions));
+        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_pre_versions) == 32, " found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_pre_versions));
+        LASSERTF((int)offsetof(struct ptlrpc_body, pb_padding) == 120, " found %lld\n",
+                 (long long)(int)offsetof(struct ptlrpc_body, pb_padding));
+        LASSERTF((int)sizeof(((struct ptlrpc_body *)0)->pb_padding) == 32, " found %lld\n",
+                 (long long)(int)sizeof(((struct ptlrpc_body *)0)->pb_padding));
+
 
         /* Checks for struct obd_connect_data */
         LASSERTF((int)sizeof(struct obd_connect_data) == 72, " found %lld\n",
@@ -435,18 +443,18 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct obd_connect_data, ocd_group));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_group) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_group));
-        LASSERTF((int)offsetof(struct obd_connect_data, padding1) == 52, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, ocd_cksum_types) == 52, " found %lld\n",
+                 (long long)(int)offsetof(struct obd_connect_data, ocd_cksum_types));
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types));
+        LASSERTF((int)offsetof(struct obd_connect_data, padding1) == 56, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, padding1));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding1) == 4, " found %lld\n",
+        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding1) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->padding1));
-        LASSERTF((int)offsetof(struct obd_connect_data, padding2) == 56, " found %lld\n",
+        LASSERTF((int)offsetof(struct obd_connect_data, padding2) == 64, " found %lld\n",
                  (long long)(int)offsetof(struct obd_connect_data, padding2));
         LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding2) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct obd_connect_data *)0)->padding2));
-        LASSERTF((int)offsetof(struct obd_connect_data, padding3) == 64, " found %lld\n",
-                 (long long)(int)offsetof(struct obd_connect_data, padding3));
-        LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding3) == 8, " found %lld\n",
-                 (long long)(int)sizeof(((struct obd_connect_data *)0)->padding3));
         CLASSERT(OBD_CONNECT_RDONLY == 0x00000001ULL);
         CLASSERT(OBD_CONNECT_INDEX == 0x00000002ULL);
         CLASSERT(OBD_CONNECT_GRANT == 0x00000008ULL);
@@ -455,6 +463,8 @@ void lustre_assert_wire_constants(void)
         CLASSERT(OBD_CONNECT_REQPORTAL == 0x00000040ULL);
         CLASSERT(OBD_CONNECT_ACL == 0x00000080ULL);
         CLASSERT(OBD_CONNECT_XATTR == 0x00000100ULL);
+        CLASSERT(OBD_CONNECT_REAL == 0x08000000ULL);
+        CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
         CLASSERT(OBD_CONNECT_TRUNCLOCK == 0x00000400ULL);
         CLASSERT(OBD_CONNECT_IBITS == 0x00001000ULL);
         CLASSERT(OBD_CONNECT_JOIN == 0x00002000ULL);
@@ -466,13 +476,11 @@ void lustre_assert_wire_constants(void)
         CLASSERT(OBD_CONNECT_QUOTA64 == 0x00080000ULL);
         CLASSERT(OBD_CONNECT_MDS_CAPA == 0x00100000ULL);
         CLASSERT(OBD_CONNECT_OSS_CAPA == 0x00200000ULL);
-        CLASSERT(OBD_CONNECT_CANCELSET == 0x00400000ULL);
+        CLASSERT(OBD_CONNECT_MDS_MDS == 0x04000000ULL);
         CLASSERT(OBD_CONNECT_SOM == 0x00800000ULL);
         CLASSERT(OBD_CONNECT_AT == 0x01000000ULL);
+        CLASSERT(OBD_CONNECT_CANCELSET == 0x00400000ULL);
         CLASSERT(OBD_CONNECT_LRU_RESIZE == 0x02000000ULL);
-        CLASSERT(OBD_CONNECT_MDS_MDS == 0x04000000ULL);
-        CLASSERT(OBD_CONNECT_REAL == 0x08000000ULL);
-        CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
 
         /* Checks for struct obdo */
         LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n",
@@ -616,6 +624,11 @@ void lustre_assert_wire_constants(void)
         CLASSERT(OBD_FL_DEBUG_CHECK == (0x00000040));
         CLASSERT(OBD_FL_NO_USRQUOTA == (0x00000100));
         CLASSERT(OBD_FL_NO_GRPQUOTA == (0x00000200));
+        CLASSERT(OBD_FL_TRUNCLOCK == (0x00000800));
+        CLASSERT(OBD_FL_CKSUM_CRC32 == (0x00001000));
+        CLASSERT(OBD_FL_CKSUM_ADLER == (0x00002000));
+        CLASSERT(OBD_CKSUM_CRC32 == 1);
+        CLASSERT(OBD_CKSUM_ADLER == 2);
 
         /* Checks for struct lov_mds_md_v1 */
         LASSERTF((int)sizeof(struct lov_mds_md_v1) == 32, " found %lld\n",
@@ -1150,22 +1163,22 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct mds_rec_setattr, sa_attr_flags));
         LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags) == 4, " found %lld\n",
                  (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags));
-        CLASSERT(MDS_ATTR_MODE == 1);
-        CLASSERT(MDS_ATTR_UID == 2);
-        CLASSERT(MDS_ATTR_GID == 4);
-        CLASSERT(MDS_ATTR_SIZE == 8);
-        CLASSERT(MDS_ATTR_ATIME == 16);
-        CLASSERT(MDS_ATTR_MTIME == 32);
-        CLASSERT(MDS_ATTR_CTIME == 64);
-        CLASSERT(MDS_ATTR_ATIME_SET == 128);
-        CLASSERT(MDS_ATTR_MTIME_SET == 256);
-        CLASSERT(MDS_ATTR_FORCE == 512);
-        CLASSERT(MDS_ATTR_ATTR_FLAG == 1024);
-        CLASSERT(MDS_ATTR_KILL_SUID == 2048);
-        CLASSERT(MDS_ATTR_KILL_SGID == 4096);
-        CLASSERT(MDS_ATTR_CTIME_SET == 8192);
-        CLASSERT(MDS_ATTR_FROM_OPEN == 16384);
-        CLASSERT(MDS_ATTR_BLOCKS == 32768);
+        CLASSERT(MDS_ATTR_MODE == 0x1ULL);
+        CLASSERT(MDS_ATTR_UID == 0x2ULL);
+        CLASSERT(MDS_ATTR_GID == 0x4ULL);
+        CLASSERT(MDS_ATTR_SIZE == 0x8ULL);
+        CLASSERT(MDS_ATTR_ATIME == 0x10ULL);
+        CLASSERT(MDS_ATTR_MTIME == 0x20ULL);
+        CLASSERT(MDS_ATTR_CTIME == 0x40ULL);
+        CLASSERT(MDS_ATTR_ATIME_SET == 0x80ULL);
+        CLASSERT(MDS_ATTR_MTIME_SET == 0x100ULL);
+        CLASSERT(MDS_ATTR_FORCE == 0x200ULL);
+        CLASSERT(MDS_ATTR_ATTR_FLAG == 0x400ULL);
+        CLASSERT(MDS_ATTR_KILL_SUID == 0x800ULL);
+        CLASSERT(MDS_ATTR_KILL_SGID == 0x1000ULL);
+        CLASSERT(MDS_ATTR_CTIME_SET == 0x2000ULL);
+        CLASSERT(MDS_ATTR_FROM_OPEN == 0x4000ULL);
+        CLASSERT(MDS_ATTR_BLOCKS == 0x8000ULL);
 
         /* Checks for struct mds_rec_create */
         LASSERTF((int)sizeof(struct mds_rec_create) == 96, " found %lld\n",
@@ -2125,5 +2138,35 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct lustre_disk_data, ldd_params));
         LASSERTF((int)sizeof(((struct lustre_disk_data *)0)->ldd_params) == 4096, " found %lld\n",
                  (long long)(int)sizeof(((struct lustre_disk_data *)0)->ldd_params));
+#ifdef LIBLUSTRE_POSIX_ACL
+
+        /* Checks for type posix_acl_xattr_entry */
+        LASSERTF((int)sizeof(xattr_acl_entry) == 8, " found %lld\n",
+                 (long long)(int)sizeof(xattr_acl_entry));
+        LASSERTF((int)offsetof(xattr_acl_entry, e_tag) == 0, " found %lld\n",
+                 (long long)(int)offsetof(xattr_acl_entry, e_tag));
+        LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_tag) == 2, " found %lld\n",
+                 (long long)(int)sizeof(((xattr_acl_entry *)0)->e_tag));
+        LASSERTF((int)offsetof(xattr_acl_entry, e_perm) == 2, " found %lld\n",
+                 (long long)(int)offsetof(xattr_acl_entry, e_perm));
+        LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_perm) == 2, " found %lld\n",
+                 (long long)(int)sizeof(((xattr_acl_entry *)0)->e_perm));
+        LASSERTF((int)offsetof(xattr_acl_entry, e_id) == 4, " found %lld\n",
+                 (long long)(int)offsetof(xattr_acl_entry, e_id));
+        LASSERTF((int)sizeof(((xattr_acl_entry *)0)->e_id) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((xattr_acl_entry *)0)->e_id));
+
+        /* Checks for type posix_acl_xattr_header */
+        LASSERTF((int)sizeof(xattr_acl_header) == 4, " found %lld\n",
+                 (long long)(int)sizeof(xattr_acl_header));
+        LASSERTF((int)offsetof(xattr_acl_header, a_version) == 0, " found %lld\n",
+                 (long long)(int)offsetof(xattr_acl_header, a_version));
+        LASSERTF((int)sizeof(((xattr_acl_header *)0)->a_version) == 4, " found %lld\n",
+                 (long long)(int)sizeof(((xattr_acl_header *)0)->a_version));
+        LASSERTF((int)offsetof(xattr_acl_header, a_entries) == 4, " found %lld\n",
+                 (long long)(int)offsetof(xattr_acl_header, a_entries));
+        LASSERTF((int)sizeof(((xattr_acl_header *)0)->a_entries) == 0, " found %lld\n",
+                 (long long)(int)sizeof(((xattr_acl_header *)0)->a_entries));
+#endif
 }