From d9df39505530c5f224427103290b60828c11e81c Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Mon, 11 Sep 2023 17:31:09 +0200 Subject: [PATCH] LU-17108 nodemap: make map_mode available for default nm The map_mode property lets control the way mapping is carried out. It is already available on regular nodemaps, to decide whether uids, gids and/or projids will be mapped. On the default nodemap, where it is not possible to define mappings, the map_mode property will be taken into account when trusted is 0 and deny_unknown is 0. Unmapped IDs will be left unchanged. Signed-off-by: Sebastien Buisson Change-Id: I16a2f5cfda11a8435b56a00f3e97bdc70741c156 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52336 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Patrick Farrell Reviewed-by: Oleg Drokin --- lustre/ptlrpc/nodemap_lproc.c | 53 +++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/lustre/ptlrpc/nodemap_lproc.c b/lustre/ptlrpc/nodemap_lproc.c index 23d8534..824fa95 100644 --- a/lustre/ptlrpc/nodemap_lproc.c +++ b/lustre/ptlrpc/nodemap_lproc.c @@ -903,55 +903,60 @@ static struct lprocfs_vars lprocfs_nodemap_vars[] = { }; static struct lprocfs_vars lprocfs_default_nodemap_vars[] = { - { - .name = "id", - .fops = &nodemap_id_fops, - }, - { - .name = "trusted_nodemap", - .fops = &nodemap_trusted_fops, - }, + /* in alphabetical order */ { .name = "admin_nodemap", .fops = &nodemap_admin_fops, }, { - .name = "deny_unknown", - .fops = &nodemap_deny_unknown_fops, - }, - { - .name = "squash_uid", - .fops = &nodemap_squash_uid_fops, + .name = "audit_mode", + .fops = &nodemap_audit_mode_fops, }, { - .name = "squash_gid", - .fops = &nodemap_squash_gid_fops, + .name = "deny_unknown", + .fops = &nodemap_deny_unknown_fops, }, { - .name = "squash_projid", - .fops = &nodemap_squash_projid_fops, + .name = "exports", + .fops = &nodemap_exports_fops, }, { .name = "fileset", .fops = &nodemap_fileset_fops, }, { - .name = "exports", - .fops = &nodemap_exports_fops, + .name = "forbid_encryption", + .fops = &nodemap_forbid_encryption_fops, }, { - .name = "audit_mode", - .fops = &nodemap_audit_mode_fops, + .name = "id", + .fops = &nodemap_id_fops, }, { - .name = "forbid_encryption", - .fops = &nodemap_forbid_encryption_fops, + .name = "map_mode", + .fops = &nodemap_map_mode_fops, }, { .name = "readonly_mount", .fops = &nodemap_readonly_mount_fops, }, { + .name = "squash_gid", + .fops = &nodemap_squash_gid_fops, + }, + { + .name = "squash_projid", + .fops = &nodemap_squash_projid_fops, + }, + { + .name = "squash_uid", + .fops = &nodemap_squash_uid_fops, + }, + { + .name = "trusted_nodemap", + .fops = &nodemap_trusted_fops, + }, + { NULL } }; -- 1.8.3.1