* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include <stdio.h>
#include <libcfs/libcfs.h>
#include <lustre/lustre_idl.h>
+#include <lustre/lustre_lfsck_user.h>
#include <lustre_disk.h>
#undef LASSERT
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwiretest)
- * running on Linux t 2.6.32-358.18.1.el6.lustre.x86_64 #1 SMP Mon Sep 2 15:21:03 CDT 2013 x8
+ * running on Linux q 2.6.32-431.5.1.el6.lustre.x86_64 #1 SMP Wed Feb 12 11:01:08 CST 2014 x8
* with gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) */
OBD_CONNECT_OPEN_BY_FID);
LASSERTF(OBD_CONNECT_LFSCK == 0x40000000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_LFSCK);
+ LASSERTF(OBD_CONNECT_UNLINK_CLOSE == 0x100000000000000ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_UNLINK_CLOSE);
+ LASSERTF(OBD_CONNECT_DIR_STRIPE == 0x400000000000000ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_DIR_STRIPE);
LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)OBD_CKSUM_CRC32);
LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
LASSERTF(LOV_PATTERN_CMOBD == 0x00000200UL, "found 0x%.8xUL\n",
(unsigned)LOV_PATTERN_CMOBD);
+ /* Checks for struct lmv_mds_md_v1 */
+ LASSERTF((int)sizeof(struct lmv_mds_md_v1) == 56, "found %lld\n",
+ (long long)(int)sizeof(struct lmv_mds_md_v1));
+ LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_magic) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_magic));
+ LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_magic) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_magic));
+ LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_stripe_count) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_stripe_count));
+ LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_stripe_count) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_stripe_count));
+ LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_master_mdt_index) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_master_mdt_index));
+ LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_master_mdt_index) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_master_mdt_index));
+ LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_hash_type) == 12, "found %lld\n",
+ (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_hash_type));
+ LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_hash_type) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_hash_type));
+ LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_layout_version) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_layout_version));
+ LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_layout_version) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_layout_version));
+ LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_padding1) == 20, "found %lld\n",
+ (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_padding1));
+ LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_padding1) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_padding1));
+ LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_padding2) == 24, "found %lld\n",
+ (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_padding2));
+ LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_padding2) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_padding2));
+ LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_padding3) == 32, "found %lld\n",
+ (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_padding3));
+ LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_padding3) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_padding3));
+ LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_pool_name[16]) == 56, "found %lld\n",
+ (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_pool_name[16]));
+ LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_pool_name[16]) == 1, "found %lld\n",
+ (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_pool_name[16]));
+ LASSERTF((int)offsetof(struct lmv_mds_md_v1, lmv_stripe_fids[0]) == 56, "found %lld\n",
+ (long long)(int)offsetof(struct lmv_mds_md_v1, lmv_stripe_fids[0]));
+ LASSERTF((int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_stripe_fids[0]) == 16, "found %lld\n",
+ (long long)(int)sizeof(((struct lmv_mds_md_v1 *)0)->lmv_stripe_fids[0]));
+ CLASSERT(LMV_MAGIC_V1 == 0x0CD20CD0);
+ CLASSERT(LMV_MAGIC_STRIPE == 0x0CD40CD0);
+ CLASSERT(LMV_HASH_TYPE_MASK == 0x0000ffff);
+ CLASSERT(LMV_HASH_FLAG_MIGRATION == 0x80000000);
+ CLASSERT(LMV_HASH_FLAG_DEAD == 0x40000000);
+
/* Checks for struct obd_statfs */
LASSERTF((int)sizeof(struct obd_statfs) == 144, "found %lld\n",
(long long)(int)sizeof(struct obd_statfs));
/* Checks for struct niobuf_remote */
LASSERTF((int)sizeof(struct niobuf_remote) == 16, "found %lld\n",
(long long)(int)sizeof(struct niobuf_remote));
- LASSERTF((int)offsetof(struct niobuf_remote, offset) == 0, "found %lld\n",
- (long long)(int)offsetof(struct niobuf_remote, offset));
- LASSERTF((int)sizeof(((struct niobuf_remote *)0)->offset) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct niobuf_remote *)0)->offset));
- LASSERTF((int)offsetof(struct niobuf_remote, len) == 8, "found %lld\n",
- (long long)(int)offsetof(struct niobuf_remote, len));
- LASSERTF((int)sizeof(((struct niobuf_remote *)0)->len) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct niobuf_remote *)0)->len));
- LASSERTF((int)offsetof(struct niobuf_remote, flags) == 12, "found %lld\n",
- (long long)(int)offsetof(struct niobuf_remote, flags));
- LASSERTF((int)sizeof(((struct niobuf_remote *)0)->flags) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct niobuf_remote *)0)->flags));
+ LASSERTF((int)offsetof(struct niobuf_remote, rnb_offset) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, rnb_offset));
+ LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_offset) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_offset));
+ LASSERTF((int)offsetof(struct niobuf_remote, rnb_len) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, rnb_len));
+ LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_len) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_len));
+ LASSERTF((int)offsetof(struct niobuf_remote, rnb_flags) == 12, "found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, rnb_flags));
+ LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_flags) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_flags));
LASSERTF(OBD_BRW_READ == 0x01, "found 0x%.8x\n",
OBD_BRW_READ);
LASSERTF(OBD_BRW_WRITE == 0x02, "found 0x%.8x\n",
CLASSERT(LLOG_ORIGIN_HANDLE_DESTROY == 509);
CLASSERT(LLOG_FIRST_OPC == 501);
CLASSERT(LLOG_LAST_OPC == 510);
+ CLASSERT(LLOG_CONFIG_ORIG_CTXT == 0);
+ CLASSERT(LLOG_CONFIG_REPL_CTXT == 1);
+ CLASSERT(LLOG_MDS_OST_ORIG_CTXT == 2);
+ CLASSERT(LLOG_MDS_OST_REPL_CTXT == 3);
+ CLASSERT(LLOG_SIZE_ORIG_CTXT == 4);
+ CLASSERT(LLOG_SIZE_REPL_CTXT == 5);
+ CLASSERT(LLOG_TEST_ORIG_CTXT == 8);
+ CLASSERT(LLOG_TEST_REPL_CTXT == 9);
+ CLASSERT(LLOG_CHANGELOG_ORIG_CTXT == 12);
+ CLASSERT(LLOG_CHANGELOG_REPL_CTXT == 13);
+ CLASSERT(LLOG_CHANGELOG_USER_ORIG_CTXT == 14);
+ CLASSERT(LLOG_AGENT_ORIG_CTXT == 15);
+ CLASSERT(LLOG_MAX_CTXTS == 16);
/* Checks for struct llogd_conn_body */
LASSERTF((int)sizeof(struct llogd_conn_body) == 40, "found %lld\n",
CLASSERT(FIEMAP_EXTENT_NO_DIRECT == 0x40000000);
CLASSERT(FIEMAP_EXTENT_NET == 0x80000000);
+#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));
+ LASSERTF((int)offsetof(posix_acl_xattr_entry, e_tag) == 0, "found %lld\n",
+ (long long)(int)offsetof(posix_acl_xattr_entry, e_tag));
+ LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_tag) == 2, "found %lld\n",
+ (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_tag));
+ LASSERTF((int)offsetof(posix_acl_xattr_entry, e_perm) == 2, "found %lld\n",
+ (long long)(int)offsetof(posix_acl_xattr_entry, e_perm));
+ LASSERTF((int)sizeof(((posix_acl_xattr_entry *)0)->e_perm) == 2, "found %lld\n",
+ (long long)(int)sizeof(((posix_acl_xattr_entry *)0)->e_perm));
+ LASSERTF((int)offsetof(posix_acl_xattr_entry, e_id) == 4, "found %lld\n",
+ (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_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));
+ LASSERTF((int)offsetof(posix_acl_xattr_header, a_version) == 0, "found %lld\n",
+ (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));
+ 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 /* CONFIG_FS_POSIX_ACL */
+
/* Checks for struct link_ea_header */
LASSERTF((int)sizeof(struct link_ea_header) == 24, "found %lld\n",
(long long)(int)sizeof(struct link_ea_header));
(long long)(int)offsetof(struct lfsck_request, lr_padding_3));
LASSERTF((int)sizeof(((struct lfsck_request *)0)->lr_padding_3) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lfsck_request *)0)->lr_padding_3));
+ LASSERTF(LFSCK_TYPE_SCRUB == 0x00000000UL, "found 0x%.8xUL\n",
+ (unsigned)LFSCK_TYPE_SCRUB);
+ LASSERTF(LFSCK_TYPE_LAYOUT == 0x00000001UL, "found 0x%.8xUL\n",
+ (unsigned)LFSCK_TYPE_LAYOUT);
+ LASSERTF(LFSCK_TYPE_DNE == 0x00000002UL, "found 0x%.8xUL\n",
+ (unsigned)LFSCK_TYPE_DNE);
+ LASSERTF(LFSCK_TYPE_NAMESPACE == 0x00000004UL, "found 0x%.8xUL\n",
+ (unsigned)LFSCK_TYPE_NAMESPACE);
LASSERTF(LE_LASTID_REBUILDING == 1, "found %lld\n",
(long long)LE_LASTID_REBUILDING);
LASSERTF(LE_LASTID_REBUILT == 2, "found %lld\n",