* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2014, Intel Corporation.
+ * Copyright (c) 2011, 2015, 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>
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwiretest)
- * 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) */
+ * running on Linux centss05 2.6.32.431.29.2.el6_lustre #1 SMP Tue Sep 23 16:06:38 CDT 2014 x
+ * with gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) */
+
/* Constants... */
LASSERTF(PTL_RPC_MSG_REQUEST == 4711, "found %lld\n",
(long long)MDS_STATUS_CONN);
LASSERTF(MDS_STATUS_LOV == 2, "found %lld\n",
(long long)MDS_STATUS_LOV);
- LASSERTF(LUSTRE_BFLAG_UNCOMMITTED_WRITES == 1, "found %lld\n",
- (long long)LUSTRE_BFLAG_UNCOMMITTED_WRITES);
LASSERTF(MDS_ATTR_MODE == 0x0000000000000001ULL, "found 0x%.16llxULL\n",
(long long)MDS_ATTR_MODE);
LASSERTF(MDS_ATTR_UID == 0x0000000000000002ULL, "found 0x%.16llxULL\n",
(int)offsetof(struct ptlrpc_body_v3, pb_padding64_2), (int)offsetof(struct ptlrpc_body_v2, pb_padding64_2));
LASSERTF((int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding64_2) == (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding64_2), "%d != %d\n",
(int)sizeof(((struct ptlrpc_body_v3 *)0)->pb_padding64_2), (int)sizeof(((struct ptlrpc_body_v2 *)0)->pb_padding64_2));
-
LASSERTF(MSG_PTLRPC_BODY_OFF == 0, "found %lld\n",
(long long)MSG_PTLRPC_BODY_OFF);
LASSERTF(REQ_REC_OFF == 1, "found %lld\n",
OBD_CONNECT_MULTIMODRPCS);
LASSERTF(OBD_CONNECT_DIR_STRIPE == 0x400000000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_DIR_STRIPE);
+ LASSERTF(OBD_CONNECT_SUBTREE == 0x800000000000000ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_SUBTREE);
+ LASSERTF(OBD_CONNECT_LOCK_AHEAD == 0x1000000000000000ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_LOCK_AHEAD);
+ LASSERTF(OBD_CONNECT_BULK_MBITS == 0x2000000000000000ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_BULK_MBITS);
+ LASSERTF(OBD_CONNECT_OBDOPACK == 0x4000000000000000ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_OBDOPACK);
LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)OBD_CKSUM_CRC32);
LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
LUSTRE_IMMUTABLE_FL);
LASSERTF(LUSTRE_APPEND_FL == 0x00000020, "found 0x%.8x\n",
LUSTRE_APPEND_FL);
+ LASSERTF(LUSTRE_NODUMP_FL == 0x00000040, "found 0x%.8x\n",
+ LUSTRE_NODUMP_FL);
LASSERTF(LUSTRE_NOATIME_FL == 0x00000080, "found 0x%.8x\n",
LUSTRE_NOATIME_FL);
+ LASSERTF(LUSTRE_INDEX_FL == 0x00001000, "found 0x%.8x\n",
+ LUSTRE_INDEX_FL);
LASSERTF(LUSTRE_DIRSYNC_FL == 0x00010000, "found 0x%.8x\n",
LUSTRE_DIRSYNC_FL);
+ LASSERTF(LUSTRE_TOPDIR_FL == 0x00020000, "found 0x%.8x\n",
+ LUSTRE_TOPDIR_FL);
+ LASSERTF(LUSTRE_DIRECTIO_FL == 0x00100000, "found 0x%.8x\n",
+ LUSTRE_DIRECTIO_FL);
+ LASSERTF(LUSTRE_INLINE_DATA_FL == 0x10000000, "found 0x%.8x\n",
+ LUSTRE_INLINE_DATA_FL);
LASSERTF(MDS_INODELOCK_LOOKUP == 0x000001, "found 0x%.8x\n",
MDS_INODELOCK_LOOKUP);
LASSERTF(MDS_INODELOCK_UPDATE == 0x000002, "found 0x%.8x\n",
(long long)(int)offsetof(struct ldlm_intent, opc));
LASSERTF((int)sizeof(((struct ldlm_intent *)0)->opc) == 8, "found %lld\n",
(long long)(int)sizeof(((struct ldlm_intent *)0)->opc));
+ LASSERTF(IT_OPEN == 1, "found %lld\n",
+ (long long)IT_OPEN);
+ LASSERTF(IT_CREAT == 2, "found %lld\n",
+ (long long)IT_CREAT);
+ LASSERTF(IT_READDIR == 4, "found %lld\n",
+ (long long)IT_READDIR);
+ LASSERTF(IT_GETATTR == 8, "found %lld\n",
+ (long long)IT_GETATTR);
+ LASSERTF(IT_LOOKUP == 16, "found %lld\n",
+ (long long)IT_LOOKUP);
+ LASSERTF(IT_UNLINK == 32, "found %lld\n",
+ (long long)IT_UNLINK);
+ LASSERTF(IT_TRUNC == 64, "found %lld\n",
+ (long long)IT_TRUNC);
+ LASSERTF(IT_GETXATTR == 128, "found %lld\n",
+ (long long)IT_GETXATTR);
+ LASSERTF(IT_EXEC == 256, "found %lld\n",
+ (long long)IT_EXEC);
+ LASSERTF(IT_PIN == 512, "found %lld\n",
+ (long long)IT_PIN);
+ LASSERTF(IT_LAYOUT == 1024, "found %lld\n",
+ (long long)IT_LAYOUT);
+ LASSERTF(IT_QUOTA_DQACQ == 2048, "found %lld\n",
+ (long long)IT_QUOTA_DQACQ);
+ LASSERTF(IT_QUOTA_CONN == 4096, "found %lld\n",
+ (long long)IT_QUOTA_CONN);
+ LASSERTF(IT_SETXATTR == 8192, "found %lld\n",
+ (long long)IT_SETXATTR);
/* Checks for struct ldlm_resource_desc */
LASSERTF((int)sizeof(struct ldlm_resource_desc) == 40, "found %lld\n",
(long long)(int)offsetof(struct ldlm_resource_desc, lr_type));
LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_type) == 4, "found %lld\n",
(long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_type));
- LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_padding) == 4, "found %lld\n",
- (long long)(int)offsetof(struct ldlm_resource_desc, lr_padding));
- LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_padding) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_padding));
+ LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_pad) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct ldlm_resource_desc, lr_pad));
+ LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_pad) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_pad));
LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_name) == 8, "found %lld\n",
(long long)(int)offsetof(struct ldlm_resource_desc, lr_name));
LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_name) == 32, "found %lld\n",
(long long)(int)offsetof(struct llog_log_hdr, llh_tgtuuid));
LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid) == 40, "found %lld\n",
(long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid));
- LASSERTF((int)offsetof(struct llog_log_hdr, llh_reserved) == 84, "found %lld\n",
- (long long)(int)offsetof(struct llog_log_hdr, llh_reserved));
- LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_reserved) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_reserved));
- LASSERTF((int)offsetof(struct llog_log_hdr, llh_bitmap) == 88, "found %lld\n",
- (long long)(int)offsetof(struct llog_log_hdr, llh_bitmap));
- LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 8096, "found %lld\n",
- (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap));
- LASSERTF((int)offsetof(struct llog_log_hdr, llh_tail) == 8184, "found %lld\n",
- (long long)(int)offsetof(struct llog_log_hdr, llh_tail));
- LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tail) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tail));
/* Checks for struct llog_cookie */
LASSERTF((int)sizeof(struct llog_cookie) == 32, "found %lld\n",
(long long)(int)offsetof(struct fiemap_extent, fe_flags));
LASSERTF((int)sizeof(((struct fiemap_extent *)0)->fe_flags) == 4, "found %lld\n",
(long long)(int)sizeof(((struct fiemap_extent *)0)->fe_flags));
- LASSERTF((int)offsetof(struct fiemap_extent, fe_device) == 44, "found %lld\n",
- (long long)(int)offsetof(struct fiemap_extent, fe_device));
- LASSERTF((int)sizeof(((struct fiemap_extent *)0)->fe_device) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct fiemap_extent *)0)->fe_device));
+ LASSERTF((int)offsetof(struct fiemap_extent, fe_reserved[0]) == 44, "found %lld\n",
+ (long long)(int)offsetof(struct fiemap_extent, fe_reserved[0]));
+ LASSERTF((int)sizeof(((struct fiemap_extent *)0)->fe_reserved[0]) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct fiemap_extent *)0)->fe_reserved[0]));
CLASSERT(FIEMAP_EXTENT_LAST == 0x00000001);
CLASSERT(FIEMAP_EXTENT_UNKNOWN == 0x00000002);
CLASSERT(FIEMAP_EXTENT_DELALLOC == 0x00000004);
(long long)(int)offsetof(struct object_update, ou_params_count));
LASSERTF((int)sizeof(((struct object_update *)0)->ou_params_count) == 2, "found %lld\n",
(long long)(int)sizeof(((struct object_update *)0)->ou_params_count));
- LASSERTF((int)offsetof(struct object_update, ou_master_index) == 4, "found %lld\n",
- (long long)(int)offsetof(struct object_update, ou_master_index));
- LASSERTF((int)sizeof(((struct object_update *)0)->ou_master_index) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct object_update *)0)->ou_master_index));
+ LASSERTF((int)offsetof(struct object_update, ou_result_size) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct object_update, ou_result_size));
+ LASSERTF((int)sizeof(((struct object_update *)0)->ou_result_size) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct object_update *)0)->ou_result_size));
LASSERTF((int)offsetof(struct object_update, ou_flags) == 8, "found %lld\n",
(long long)(int)offsetof(struct object_update, ou_flags));
LASSERTF((int)sizeof(((struct object_update *)0)->ou_flags) == 4, "found %lld\n",
LASSERTF((int)sizeof(((struct object_update_reply *)0)->ourp_lens) == 0, "found %lld\n",
(long long)(int)sizeof(((struct object_update_reply *)0)->ourp_lens));
+ /* Checks for struct out_update_header */
+ LASSERTF((int)sizeof(struct out_update_header) == 16, "found %lld\n",
+ (long long)(int)sizeof(struct out_update_header));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_magic) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_magic));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_magic) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_magic));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_count) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_count));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_count) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_count));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_inline_length) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_inline_length));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_inline_length) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_inline_length));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_reply_size) == 12, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_reply_size));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_reply_size) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_reply_size));
+ LASSERTF((int)offsetof(struct out_update_header, ouh_inline_data) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_header, ouh_inline_data));
+ LASSERTF((int)sizeof(((struct out_update_header *)0)->ouh_inline_data) == 0, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_header *)0)->ouh_inline_data));
+
+ /* Checks for struct out_update_buffer */
+ LASSERTF((int)sizeof(struct out_update_buffer) == 8, "found %lld\n",
+ (long long)(int)sizeof(struct out_update_buffer));
+ LASSERTF((int)offsetof(struct out_update_buffer, oub_size) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_buffer, oub_size));
+ LASSERTF((int)sizeof(((struct out_update_buffer *)0)->oub_size) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_buffer *)0)->oub_size));
+ LASSERTF((int)offsetof(struct out_update_buffer, oub_padding) == 4, "found %lld\n",
+ (long long)(int)offsetof(struct out_update_buffer, oub_padding));
+ LASSERTF((int)sizeof(((struct out_update_buffer *)0)->oub_padding) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct out_update_buffer *)0)->oub_padding));
+
/* Checks for struct lfsck_request */
LASSERTF((int)sizeof(struct lfsck_request) == 96, "found %lld\n",
(long long)(int)sizeof(struct lfsck_request));
(long long)(int)offsetof(struct lfsck_reply, lr_padding_2));
LASSERTF((int)sizeof(((struct lfsck_reply *)0)->lr_padding_2) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lfsck_reply *)0)->lr_padding_2));
+
+ /* Checks for struct update_params */
+ LASSERTF((int)sizeof(struct update_params) == 0, "found %lld\n",
+ (long long)(int)sizeof(struct update_params));
+ LASSERTF((int)offsetof(struct update_params, up_params) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct update_params, up_params));
+ LASSERTF((int)sizeof(((struct update_params *)0)->up_params) == 0, "found %lld\n",
+ (long long)(int)sizeof(((struct update_params *)0)->up_params));
+
+ /* Checks for struct update_op */
+ LASSERTF((int)sizeof(struct update_op) == 24, "found %lld\n",
+ (long long)(int)sizeof(struct update_op));
+ LASSERTF((int)offsetof(struct update_op, uop_fid) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct update_op, uop_fid));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_fid) == 16, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_fid));
+ LASSERTF((int)offsetof(struct update_op, uop_type) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct update_op, uop_type));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_type) == 2, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_type));
+ LASSERTF((int)offsetof(struct update_op, uop_param_count) == 18, "found %lld\n",
+ (long long)(int)offsetof(struct update_op, uop_param_count));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_param_count) == 2, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_param_count));
+ LASSERTF((int)offsetof(struct update_op, uop_params_off) == 20, "found %lld\n",
+ (long long)(int)offsetof(struct update_op, uop_params_off));
+ LASSERTF((int)sizeof(((struct update_op *)0)->uop_params_off) == 0, "found %lld\n",
+ (long long)(int)sizeof(((struct update_op *)0)->uop_params_off));
+
+ /* Checks for struct update_ops */
+ LASSERTF((int)sizeof(struct update_ops) == 0, "found %lld\n",
+ (long long)(int)sizeof(struct update_ops));
+ LASSERTF((int)offsetof(struct update_ops, uops_op) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct update_ops, uops_op));
+ LASSERTF((int)sizeof(((struct update_ops *)0)->uops_op) == 0, "found %lld\n",
+ (long long)(int)sizeof(((struct update_ops *)0)->uops_op));
+
+ /* Checks for struct update_records */
+ LASSERTF((int)sizeof(struct update_records) == 32, "found %lld\n",
+ (long long)(int)sizeof(struct update_records));
+ LASSERTF((int)offsetof(struct update_records, ur_master_transno) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_master_transno));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_master_transno) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_master_transno));
+ LASSERTF((int)offsetof(struct update_records, ur_batchid) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_batchid));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_batchid) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_batchid));
+ LASSERTF((int)offsetof(struct update_records, ur_flags) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_flags));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_flags) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_flags));
+ LASSERTF((int)offsetof(struct update_records, ur_index) == 20, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_index));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_index) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_index));
+ LASSERTF((int)offsetof(struct update_records, ur_update_count) == 24, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_update_count));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_update_count) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_update_count));
+ LASSERTF((int)offsetof(struct update_records, ur_param_count) == 28, "found %lld\n",
+ (long long)(int)offsetof(struct update_records, ur_param_count));
+ LASSERTF((int)sizeof(((struct update_records *)0)->ur_param_count) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct update_records *)0)->ur_param_count));
+ LASSERTF(UPDATE_RECORD_CONTINUE == 0x00000001UL, "found 0x%.8xUL\n",
+ (unsigned)UPDATE_RECORD_CONTINUE);
+
+ /* Checks for struct llog_update_record */
+ LASSERTF((int)sizeof(struct llog_update_record) == 48, "found %lld\n",
+ (long long)(int)sizeof(struct llog_update_record));
+ LASSERTF((int)offsetof(struct llog_update_record, lur_hdr) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct llog_update_record, lur_hdr));
+ LASSERTF((int)sizeof(((struct llog_update_record *)0)->lur_hdr) == 16, "found %lld\n",
+ (long long)(int)sizeof(((struct llog_update_record *)0)->lur_hdr));
+ LASSERTF((int)offsetof(struct llog_update_record, lur_update_rec) == 16, "found %lld\n",
+ (long long)(int)offsetof(struct llog_update_record, lur_update_rec));
+ LASSERTF((int)sizeof(((struct llog_update_record *)0)->lur_update_rec) == 32, "found %lld\n",
+ (long long)(int)sizeof(((struct llog_update_record *)0)->lur_update_rec));
}