From 491f101042a4db64884ffbd402be75a21464833d Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Tue, 29 Jun 2021 17:54:59 +0200 Subject: [PATCH] LU-14797 sec: add projid to nodemap Add the ability to create id maps of a new type, projid. This also requires adding a new value to map_mode, projid_only. Finally, a new property named squash_projid is used to map all project ID to a default one. Update lctl man pages to mention these additions. Update sanity-sec test_12 and test_15 to exercise projid mapping and squash_projid property. Lustre-change: https://review.whamcloud.com/44108 Lustre-commit: 8a770616a5ad21360ecba63c3643cadd245a2a50 --- lustre/doc/lctl-nodemap-add-idmap.8 | 18 ++-- lustre/doc/lctl-nodemap-del-idmap.8 | 16 ++-- lustre/doc/lctl-nodemap-modify.8 | 16 +++- lustre/include/lustre_nodemap.h | 26 ++++-- lustre/include/uapi/linux/lustre/lustre_cfg.h | 3 + lustre/include/uapi/linux/lustre/lustre_idl.h | 2 +- lustre/ptlrpc/wiretest.c | 14 ++- lustre/tests/sanity-sec.sh | 35 ++++++++ lustre/utils/obd.c | 24 +++-- lustre/utils/wirecheck.c | 5 +- lustre/utils/wiretest.c | 14 ++- 18 files changed, 399 insertions(+), 112 deletions(-) diff --git a/lustre/doc/lctl-nodemap-add-idmap.8 b/lustre/doc/lctl-nodemap-add-idmap.8 index a2b9f8c651..cd346279d6 100644 --- a/lustre/doc/lctl-nodemap-add-idmap.8 +++ b/lustre/doc/lctl-nodemap-add-idmap.8 @@ -1,24 +1,23 @@ .TH lctl-nodemap-add-idmap 8 "2015 Jan 20" Lustre "configuration utilities" .SH NAME -lctl-nodemap-add-idmap \- Define a range of NIDs for a nodemap. - +lctl-nodemap-add-idmap \- define ID mappings for a nodemap .SH SYNOPSIS .br -.B lctl nodemap_add_idmap <--name name> <--idtype {uid|gid}> -<--idmap clientid:fsid> +.B lctl nodemap_add_idmap <--name name> <--idtype {uid|gid|projid}> +.B <--idmap clientid:fsid> .br .SH DESCRIPTION -.B nodemap_add_idmap adds an identity mapping to a nodemap. Clients that are -members of the given nodemap will have the identities of their users mapped -accordingly. +.B nodemap_add_idmap +adds an identity mapping to a nodemap. Clients that are members of the given +nodemap will have the identities of their users mapped accordingly. .SH OPTIONS .I name is the name of the nodemap that this idmap should be added to. .I idtype -is either "uid" or "gid" depending on if it is a user ID or group ID that is to -be mapped. +is either "uid" or "gid" or "projid" depending on if it is a user ID or group +ID or project ID that is to be mapped. .I idmap is the identity to map, and what it should be mapped to. The first digit is the @@ -29,6 +28,7 @@ that it should map to on the Lustre filesystem. .nf # lctl nodemap_add_idmap --name remotesite --idtype uid --idmap 2001:1001 # lctl nodemap_add_idmap --name remotesite --idtype gid --idmap 2002:1002 +# lctl nodemap_add_idmap --name remotesite --idtype projid --idmap 33:1 .fi .SH AVAILABILITY diff --git a/lustre/doc/lctl-nodemap-del-idmap.8 b/lustre/doc/lctl-nodemap-del-idmap.8 index d5af22173c..0925db9918 100644 --- a/lustre/doc/lctl-nodemap-del-idmap.8 +++ b/lustre/doc/lctl-nodemap-del-idmap.8 @@ -1,33 +1,31 @@ .TH lctl-nodemap-del-idmap 8 "2015 Jan 20" Lustre "configuration utilities" .SH NAME lctl-nodemap-del-idmap \- Delete an existing idmap from a nodemap. - .SH SYNOPSIS .br -.B lctl nodemap_del_idmap <--name name> <--idtype [uid|gid]> -<--idmap clientid:fsid> +.B lctl nodemap_del_idmap <--name name> <--idtype {uid|gid|projid}> +.B <--idmap clientid:fsid> .br .SH DESCRIPTION .B nodemap_del_idmap -deletes an idmap from a nodemap. Users or groups in the nodemap with that ID -will be squashed, if the trusted flag is not enabled. +deletes an idmap from a nodemap. Users or groups or projects in the nodemap with +that ID will be squashed, if the trusted flag is not enabled. .SH OPTIONS .I name is the name of the nodemap that this idmap should be deleted from. - .I idtype -is either "uid" or "gid" depending on if it is a user or group mapping that is -to be removed. +is either "uid" or "gid" or "projid" depending on if it is a user or group or +project ID mapping that is to be removed. .I idmap is the identity map to delete. - .SH EXAMPLES .nf # lctl nodemap_del_idmap --name remotesite --idtype uid --idmap 2001:1001 # lctl nodemap_del_idmap --name remotesite --idtype gid --idmap 2002:1002 +# lctl nodemap_del_idmap --name remotesite --idtype projid --idmap 33:1 .fi .SH AVAILABILITY diff --git a/lustre/doc/lctl-nodemap-modify.8 b/lustre/doc/lctl-nodemap-modify.8 index 6dfd0bebf3..4051b511ba 100644 --- a/lustre/doc/lctl-nodemap-modify.8 +++ b/lustre/doc/lctl-nodemap-modify.8 @@ -15,9 +15,9 @@ modifies a property of the given nodemap. .I nodemap_name is the name of the nodemap to modify - .I property_name is one of the following properties: +.RS 0.3i .PP admin .RS 4 @@ -43,6 +43,11 @@ squash_gid Defaults to 99. The group ID that unknown groups (if not trusted) and root (if not admin) should be mapped to. .RE .PP +squash_projid +.RS 4 +Defaults to 99. The project ID that unknown projects (if not trusted) should be mapped to. +.RE +.PP deny_unknown .RS 4 Defaults to off. If set to on then unknown (squashed) users will be denied @@ -63,7 +68,15 @@ activated or not. The reason not to record file system events from given clients is to prevent some nodes (e.g. backup, HSM agent nodes) from flooding the Changelogs. .RE +.PP +map_mode +.RS 4 +Defaults to all, which means the nodemap maps UIDs, GIDs, and PROJIDs. +Other possible values (multiple can be specified, comma separated) are uid to +map UIDs, gid to map GIDs, both to map UIDs and GIDs, and projid to map PROJIDs. +.RE +.RE .I value is the value to set for the property. Should be 0 or 1 for admin and trusted. @@ -71,6 +84,7 @@ is the value to set for the property. Should be 0 or 1 for admin and trusted. .nf # lctl nodemap_modify --name remotesite --property trusted --value 1 # lctl nodemap_modify --name remotesite --property admin --value 1 +# lctl nodemap_modify --name remotesite --property map_mode --value uid_only # lctl nodemap_modify --name otherremotesite --property squash_uid --value 101 .fi diff --git a/lustre/include/lustre_nodemap.h b/lustre/include/lustre_nodemap.h index 199dc79b67..15ed2700fa 100644 --- a/lustre/include/lustre_nodemap.h +++ b/lustre/include/lustre_nodemap.h @@ -44,6 +44,7 @@ enum nodemap_id_type { NODEMAP_UID, NODEMAP_GID, + NODEMAP_PROJID, }; enum nodemap_tree_type { @@ -52,9 +53,13 @@ enum nodemap_tree_type { }; enum nodemap_mapping_modes { - NODEMAP_MAP_BOTH, - NODEMAP_MAP_UID_ONLY, - NODEMAP_MAP_GID_ONLY, + NODEMAP_MAP_UID = 0x01, + NODEMAP_MAP_GID = 0x02, + NODEMAP_MAP_BOTH = 0x03, /* for compatibility */ + NODEMAP_MAP_PROJID = 0x04, + NODEMAP_MAP_ALL = NODEMAP_MAP_UID | + NODEMAP_MAP_GID | + NODEMAP_MAP_PROJID, }; struct nodemap_pde { @@ -75,10 +80,11 @@ struct lu_nodemap { bool nmf_trust_client_ids:1, nmf_deny_unknown:1, nmf_allow_root_access:1, - nmf_map_uid_only:1, - nmf_map_gid_only:1, nmf_enable_audit:1, nmf_forbid_encryption:1; + /* bitmap for mapping type */ + enum nodemap_mapping_modes + nmf_map_mode; /* unique ID set by MGS */ unsigned int nm_id; /* nodemap ref counter */ @@ -87,6 +93,8 @@ struct lu_nodemap { uid_t nm_squash_uid; /* GID to squash unmapped GIDs */ gid_t nm_squash_gid; + /* PROJID to squash unmapped PROJIDs */ + projid_t nm_squash_projid; /* NID range list */ struct list_head nm_ranges; /* lock for idmap red/black trees */ @@ -99,6 +107,10 @@ struct lu_nodemap { struct rb_root nm_fs_to_client_gidmap; /* GID map keyed by remote UID */ struct rb_root nm_client_to_fs_gidmap; + /* PROJID map keyed by local UID */ + struct rb_root nm_fs_to_client_projidmap; + /* PROJID map keyed by remote UID */ + struct rb_root nm_client_to_fs_projidmap; /* attached client members of this nodemap */ struct mutex nm_member_list_lock; struct list_head nm_member_list; @@ -136,9 +148,11 @@ int nodemap_del_range(const char *name, const lnet_nid_t nid[2]); int nodemap_set_allow_root(const char *name, bool allow_root); int nodemap_set_trust_client_ids(const char *name, bool trust_client_ids); int nodemap_set_deny_unknown(const char *name, bool deny_unknown); -int nodemap_set_mapping_mode(const char *name, enum nodemap_mapping_modes mode); +int nodemap_set_mapping_mode(const char *name, + enum nodemap_mapping_modes map_mode); int nodemap_set_squash_uid(const char *name, uid_t uid); int nodemap_set_squash_gid(const char *name, gid_t gid); +int nodemap_set_squash_projid(const char *name, projid_t projid); int nodemap_set_audit_mode(const char *name, bool enable_audit); int nodemap_set_forbid_encryption(const char *name, bool forbid_encryption); bool nodemap_can_setquota(const struct lu_nodemap *nodemap); diff --git a/lustre/include/uapi/linux/lustre/lustre_cfg.h b/lustre/include/uapi/linux/lustre/lustre_cfg.h index 520f3ef781..5bfe9fd99c 100644 --- a/lustre/include/uapi/linux/lustre/lustre_cfg.h +++ b/lustre/include/uapi/linux/lustre/lustre_cfg.h @@ -119,6 +119,8 @@ enum lcfg_command_type { * id mapping */ LCFG_NODEMAP_ADMIN = 0x00ce049, /**< allow cluster to use id 0 */ + LCFG_NODEMAP_ADD_PROJIDMAP = 0x00ce04a, /**< add a projidmap */ + LCFG_NODEMAP_DEL_PROJIDMAP = 0x00ce04b, /**< delete a projidmap */ LCFG_NODEMAP_TRUSTED = 0x00ce050, /**< trust a clusters ids */ LCFG_NODEMAP_SQUASH_UID = 0x00ce051, /**< default map uid */ LCFG_NODEMAP_SQUASH_GID = 0x00ce052, /**< default map gid */ @@ -138,6 +140,7 @@ enum lcfg_command_type { LCFG_NODEMAP_AUDIT_MODE = 0x00ce05a, /**< set the audit mode */ LCFG_NODEMAP_SET_SEPOL = 0x00ce05b, /**< set SELinux policy */ LCFG_NODEMAP_FORBID_ENCRYPT = 0x00ce05c, /**< forbid encryption */ + LCFG_NODEMAP_SQUASH_PROJID = 0x00ce05d, /**< default map projid */ }; struct lustre_cfg_bufs { diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index f803d69f56..8d4bf39522 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -3620,7 +3620,7 @@ struct nodemap_cluster_rec { char ncr_name[LUSTRE_NODEMAP_NAME_LENGTH + 1]; __u8 ncr_flags; __u16 ncr_padding1; - __u32 ncr_padding2; + __u32 ncr_squash_projid; __u32 ncr_squash_uid; __u32 ncr_squash_gid; }; diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 60441b2b6a..a0d2681b0c 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -5308,10 +5308,10 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct nodemap_cluster_rec, ncr_padding1)); LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_padding1) == 2, "found %lld\n", (long long)(int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_padding1)); - LASSERTF((int)offsetof(struct nodemap_cluster_rec, ncr_padding2) == 20, "found %lld\n", - (long long)(int)offsetof(struct nodemap_cluster_rec, ncr_padding2)); - LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_padding2) == 4, "found %lld\n", - (long long)(int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_padding2)); + LASSERTF((int)offsetof(struct nodemap_cluster_rec, ncr_squash_projid) == 20, "found %lld\n", + (long long)(int)offsetof(struct nodemap_cluster_rec, ncr_squash_projid)); + LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_squash_projid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_squash_projid)); LASSERTF((int)offsetof(struct nodemap_cluster_rec, ncr_squash_uid) == 24, "found %lld\n", (long long)(int)offsetof(struct nodemap_cluster_rec, ncr_squash_uid)); LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_squash_uid) == 4, "found %lld\n", @@ -5798,6 +5798,10 @@ void lustre_assert_wire_constants(void) (unsigned)LCFG_NODEMAP_ACTIVATE); LASSERTF(LCFG_NODEMAP_ADMIN == 0x000ce049UL, "found 0x%.8xUL\n", (unsigned)LCFG_NODEMAP_ADMIN); + LASSERTF(LCFG_NODEMAP_ADD_PROJIDMAP == 0x000ce04aUL, "found 0x%.8xUL\n", + (unsigned)LCFG_NODEMAP_ADD_PROJIDMAP); + LASSERTF(LCFG_NODEMAP_DEL_PROJIDMAP == 0x000ce04bUL, "found 0x%.8xUL\n", + (unsigned)LCFG_NODEMAP_DEL_PROJIDMAP); LASSERTF(LCFG_NODEMAP_TRUSTED == 0x000ce050UL, "found 0x%.8xUL\n", (unsigned)LCFG_NODEMAP_TRUSTED); LASSERTF(LCFG_NODEMAP_SQUASH_UID == 0x000ce051UL, "found 0x%.8xUL\n", @@ -5822,6 +5826,8 @@ void lustre_assert_wire_constants(void) (unsigned)LCFG_NODEMAP_AUDIT_MODE); LASSERTF(LCFG_NODEMAP_SET_SEPOL == 0x000ce05bUL, "found 0x%.8xUL\n", (unsigned)LCFG_NODEMAP_SET_SEPOL); + LASSERTF(LCFG_NODEMAP_SQUASH_PROJID == 0x000ce05dUL, "found 0x%.8xUL\n", + (unsigned)LCFG_NODEMAP_SQUASH_PROJID); LASSERTF(PORTALS_CFG_TYPE == 1, "found %lld\n", (long long)PORTALS_CFG_TYPE); LASSERTF(LUSTRE_CFG_TYPE == 123, "found %lld\n", diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index 922d8981c1..5213d02d8b 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -306,8 +306,11 @@ delete_range() { add_idmaps() { local i local cmd="$LCTL nodemap_add_idmap" + local do_proj=true local rc=0 + (( $MDS1_VERSION >= $(version_code 2.14.0) )) || do_proj=false + echo "Start to add idmaps ..." for ((i = 0; i < NODEMAP_COUNT; i++)); do local j @@ -325,6 +328,13 @@ add_idmaps() { --idmap $client_id:$fs_id; then rc=$((rc + 1)) fi + if $do_proj; then + if ! do_facet mgs $cmd --name $csum \ + --idtype projid --idmap \ + $client_id:$fs_id; then + rc=$((rc + 1)) + fi + fi done done @@ -402,8 +412,11 @@ update_idmaps() { #LU-10040 delete_idmaps() { local i local cmd="$LCTL nodemap_del_idmap" + local do_proj=true local rc=0 + (( $MDS1_VERSION >= $(version_code 2.14.0) )) || do_proj=false + echo "Start to delete idmaps ..." for ((i = 0; i < NODEMAP_COUNT; i++)); do local j @@ -421,6 +434,13 @@ delete_idmaps() { --idmap $client_id:$fs_id; then rc=$((rc + 1)) fi + if $do_proj; then + if ! do_facet mgs $cmd --name $csum \ + --idtype projid --idmap \ + $client_id:$fs_id; then + rc=$((rc + 1)) + fi + fi done done @@ -462,6 +482,7 @@ squash_id() { cmd[0]="$LCTL nodemap_modify --property squash_uid" cmd[1]="$LCTL nodemap_modify --property squash_gid" + cmd[2]="$LCTL nodemap_modify --property squash_projid" if ! do_facet mgs ${cmd[$3]} --name $1 --value $2; then return 1 @@ -473,6 +494,10 @@ squash_id default 99 0 wait_nm_sync default squash_uid '' inactive squash_id default 99 1 wait_nm_sync default squash_gid '' inactive +if [ "$MDS1_VERSION" -ge $(version_code 2.14.0) ]; then + squash_id default 99 2 + wait_nm_sync default squash_projid '' inactive +fi test_nid() { local cmd @@ -893,6 +918,16 @@ test_12() { done [[ $rc != 0 ]] && error "nodemap squash_gid with $rc" && return 3 + rc=0 + if (( $MDS1_VERSION >= $(version_code 2.14.0) )); then + for ((i = 0; i < NODEMAP_COUNT; i++)); do + if ! squash_id ${HOSTNAME_CHECKSUM}_${i} 88 2; then + rc=$((rc + 1)) + fi + done + fi + [[ $rc != 0 ]] && error "nodemap squash_projid with $rc" && return 5 + rc=0 delete_nodemaps rc=$? diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 87309ac0a4..86ba7880e2 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -4517,7 +4517,7 @@ int jt_nodemap_modify(int argc, char **argv) fprintf(stderr, "usage: nodemap_modify --name --property --value \n"); fprintf(stderr, - "valid properties: admin trusted map_mode squash_uid squash_gid deny_unknown audit_mode forbid_encryption\n"); + "valid properties: admin trusted map_mode squash_uid squash_gid squash_projid deny_unknown audit_mode forbid_encryption\n"); return -1; } @@ -4531,6 +4531,8 @@ int jt_nodemap_modify(int argc, char **argv) cmd = LCFG_NODEMAP_SQUASH_UID; } else if (strcmp("squash_gid", param) == 0) { cmd = LCFG_NODEMAP_SQUASH_GID; + } else if (strcmp("squash_projid", param) == 0) { + cmd = LCFG_NODEMAP_SQUASH_PROJID; } else if (strcmp("map_mode", param) == 0) { cmd = LCFG_NODEMAP_MAP_MODE; } else if (strcmp("audit_mode", param) == 0) { @@ -4588,7 +4590,7 @@ int jt_nodemap_add_idmap(int argc, char **argv) if (!nodemap_name || !idmap || !idtype) { fprintf(stderr, - "usage: %s --name --idtype [uid | gid] --idmap :\n", + "usage: %s --name --idtype [uid | gid | projid] --idmap :\n", argv[0]); return -1; } @@ -4597,9 +4599,11 @@ int jt_nodemap_add_idmap(int argc, char **argv) cmd = LCFG_NODEMAP_ADD_UIDMAP; } else if (strcmp("gid", idtype) == 0) { cmd = LCFG_NODEMAP_ADD_GIDMAP; + } else if (strcmp("projid", idtype) == 0) { + cmd = LCFG_NODEMAP_ADD_PROJIDMAP; } else { fprintf(stderr, - "usage: %s --name --idtype [uid | gid] --idmap :\n", + "usage: %s --name --idtype [uid | gid | projid] --idmap :\n", argv[0]); return -1; } @@ -4647,15 +4651,23 @@ int jt_nodemap_del_idmap(int argc, char **argv) if (!nodemap_name || !idmap || !idtype) { fprintf(stderr, - "usage: %s --name --idtype [uid | gid] --idmap :\n", + "usage: %s --name --idtype [uid | gid | projid] --idmap :\n", argv[0]); return -1; } - if (strcmp("uid", idtype) == 0) + if (strcmp("uid", idtype) == 0) { cmd = LCFG_NODEMAP_DEL_UIDMAP; - else + } else if (strcmp("gid", idtype) == 0) { cmd = LCFG_NODEMAP_DEL_GIDMAP; + } else if (strcmp("projid", idtype) == 0) { + cmd = LCFG_NODEMAP_DEL_PROJIDMAP; + } else { + fprintf(stderr, + "usage: %s --name --idtype [uid | gid | projid] --idmap :\n", + argv[0]); + return -1; + } rc = nodemap_cmd(cmd, NULL, 0, argv[0], nodemap_name, idmap, NULL); if (rc != 0) { diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 8a9f401850..1b1d859735 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -2517,7 +2517,7 @@ static void check_nodemap_cluster_rec(void) CHECK_MEMBER(nodemap_cluster_rec, ncr_name[LUSTRE_NODEMAP_NAME_LENGTH + 1]); CHECK_MEMBER(nodemap_cluster_rec, ncr_flags); CHECK_MEMBER(nodemap_cluster_rec, ncr_padding1); - CHECK_MEMBER(nodemap_cluster_rec, ncr_padding2); + CHECK_MEMBER(nodemap_cluster_rec, ncr_squash_projid); CHECK_MEMBER(nodemap_cluster_rec, ncr_squash_uid); CHECK_MEMBER(nodemap_cluster_rec, ncr_squash_gid); } @@ -2748,6 +2748,8 @@ check_lustre_cfg(void) CHECK_VALUE_X(LCFG_NODEMAP_DEL_GIDMAP); CHECK_VALUE_X(LCFG_NODEMAP_ACTIVATE); CHECK_VALUE_X(LCFG_NODEMAP_ADMIN); + CHECK_VALUE_X(LCFG_NODEMAP_ADD_PROJIDMAP); + CHECK_VALUE_X(LCFG_NODEMAP_DEL_PROJIDMAP); CHECK_VALUE_X(LCFG_NODEMAP_TRUSTED); CHECK_VALUE_X(LCFG_NODEMAP_SQUASH_UID); CHECK_VALUE_X(LCFG_NODEMAP_SQUASH_GID); @@ -2760,6 +2762,7 @@ check_lustre_cfg(void) CHECK_VALUE_X(LCFG_NODEMAP_MAP_MODE); CHECK_VALUE_X(LCFG_NODEMAP_AUDIT_MODE); CHECK_VALUE_X(LCFG_NODEMAP_SET_SEPOL); + CHECK_VALUE_X(LCFG_NODEMAP_SQUASH_PROJID); CHECK_VALUE(PORTALS_CFG_TYPE); CHECK_VALUE(LUSTRE_CFG_TYPE); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index d00f40c5a0..5449443595 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -5343,10 +5343,10 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct nodemap_cluster_rec, ncr_padding1)); LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_padding1) == 2, "found %lld\n", (long long)(int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_padding1)); - LASSERTF((int)offsetof(struct nodemap_cluster_rec, ncr_padding2) == 20, "found %lld\n", - (long long)(int)offsetof(struct nodemap_cluster_rec, ncr_padding2)); - LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_padding2) == 4, "found %lld\n", - (long long)(int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_padding2)); + LASSERTF((int)offsetof(struct nodemap_cluster_rec, ncr_squash_projid) == 20, "found %lld\n", + (long long)(int)offsetof(struct nodemap_cluster_rec, ncr_squash_projid)); + LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_squash_projid) == 4, "found %lld\n", + (long long)(int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_squash_projid)); LASSERTF((int)offsetof(struct nodemap_cluster_rec, ncr_squash_uid) == 24, "found %lld\n", (long long)(int)offsetof(struct nodemap_cluster_rec, ncr_squash_uid)); LASSERTF((int)sizeof(((struct nodemap_cluster_rec *)0)->ncr_squash_uid) == 4, "found %lld\n", @@ -5833,6 +5833,10 @@ void lustre_assert_wire_constants(void) (unsigned)LCFG_NODEMAP_ACTIVATE); LASSERTF(LCFG_NODEMAP_ADMIN == 0x000ce049UL, "found 0x%.8xUL\n", (unsigned)LCFG_NODEMAP_ADMIN); + LASSERTF(LCFG_NODEMAP_ADD_PROJIDMAP == 0x000ce04aUL, "found 0x%.8xUL\n", + (unsigned)LCFG_NODEMAP_ADD_PROJIDMAP); + LASSERTF(LCFG_NODEMAP_DEL_PROJIDMAP == 0x000ce04bUL, "found 0x%.8xUL\n", + (unsigned)LCFG_NODEMAP_DEL_PROJIDMAP); LASSERTF(LCFG_NODEMAP_TRUSTED == 0x000ce050UL, "found 0x%.8xUL\n", (unsigned)LCFG_NODEMAP_TRUSTED); LASSERTF(LCFG_NODEMAP_SQUASH_UID == 0x000ce051UL, "found 0x%.8xUL\n", @@ -5857,6 +5861,8 @@ void lustre_assert_wire_constants(void) (unsigned)LCFG_NODEMAP_AUDIT_MODE); LASSERTF(LCFG_NODEMAP_SET_SEPOL == 0x000ce05bUL, "found 0x%.8xUL\n", (unsigned)LCFG_NODEMAP_SET_SEPOL); + LASSERTF(LCFG_NODEMAP_SQUASH_PROJID == 0x000ce05dUL, "found 0x%.8xUL\n", + (unsigned)LCFG_NODEMAP_SQUASH_PROJID); LASSERTF(PORTALS_CFG_TYPE == 1, "found %lld\n", (long long)PORTALS_CFG_TYPE); LASSERTF(LUSTRE_CFG_TYPE == 123, "found %lld\n", -- 2.28.0