From b0873202f6ad61b7a62547a13edc49cfea7be742 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Tue, 23 Jan 2024 10:07:25 +0100 Subject: [PATCH] LU-17465 nodemap: change squash default value to 65534 Initially, default values for nodemap.squash_uid/gid/projid were set to 99, to match user 'nobody'. But on newer systems, nobody has changed to 65534 and 99 no longer exists. It is safe to use 65534 in all cases, as even on older systems it exists and corresponds to 'nfsnobody'. Lustre-change: https://review.whamcloud.com/53802 Lustre-commit: d4927da410525db5f0524d618da47a17fe9c7835 Test-Parameters: testlist=sanity env=ONLY=432 serverversion=EXA5 Test-Parameters: testlist=sanity env=ONLY=432 clientversion=EXA5 Test-Parameters: testlist=sanity-quota env=ONLY=75 serverversion=EXA5 Test-Parameters: testlist=sanity-quota env=ONLY=75 clientversion=EXA5 Test-Parameters: testlist=sanity-selinux env=ONLY=21 serverversion=EXA5 Test-Parameters: testlist=sanity-selinux env=ONLY=21 clientversion=EXA5 Test-Parameters: testlist=sanity-sec env=ONLY="7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 32 33 34 35 36 55 61 64" serverversion=EXA5 Test-Parameters: testlist=sanity-sec env=ONLY="7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 32 33 34 35 36 55 61 64" clientversion=EXA5 Signed-off-by: Sebastien Buisson Change-Id: I2e20fda0fdc0d5bfdf964a890bfbd0b54b943cf4 Reviewed-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53777 Tested-by: jenkins Tested-by: Maloo --- lustre/ptlrpc/nodemap_internal.h | 6 +++--- lustre/tests/cfg/local.sh | 1 + lustre/tests/sanity-sec.sh | 16 ++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lustre/ptlrpc/nodemap_internal.h b/lustre/ptlrpc/nodemap_internal.h index fc04dec..23a66ed 100644 --- a/lustre/ptlrpc/nodemap_internal.h +++ b/lustre/ptlrpc/nodemap_internal.h @@ -37,9 +37,9 @@ #define DEFAULT_NODEMAP "default" /* Default nobody uid, gid and projid values */ -#define NODEMAP_NOBODY_UID 99 -#define NODEMAP_NOBODY_GID 99 -#define NODEMAP_NOBODY_PROJID 99 +#define NODEMAP_NOBODY_UID 65534 +#define NODEMAP_NOBODY_GID 65534 +#define NODEMAP_NOBODY_PROJID 65534 struct lprocfs_static_vars; diff --git a/lustre/tests/cfg/local.sh b/lustre/tests/cfg/local.sh index 8d3e534..6cb5295 100644 --- a/lustre/tests/cfg/local.sh +++ b/lustre/tests/cfg/local.sh @@ -115,6 +115,7 @@ TSTUSR=${TSTUSR:-"quota_usr"} TSTUSR2=${TSTUSR2:-"quota_2usr"} USER0=${USER0:-"sanityusr"} USER1=${USER1:-"sanityusr1"} +NOBODY_UID=${NOBODY_UID:-65534} ENABLE_QUOTA=${ENABLE_QUOTA:-""} QUOTA_TYPE=${QUOTA_TYPE:-"ug3"} diff --git a/lustre/tests/sanity-sec.sh b/lustre/tests/sanity-sec.sh index 1ff1da7..8303862 100755 --- a/lustre/tests/sanity-sec.sh +++ b/lustre/tests/sanity-sec.sh @@ -247,9 +247,9 @@ create_nodemaps() { local i local rc - squash_id default 99 0 + squash_id default ${NOBODY_UID:-65534} 0 wait_nm_sync default squash_uid '' inactive - squash_id default 99 1 + squash_id default ${NOBODY_UID:-65534} 1 wait_nm_sync default squash_gid '' inactive for (( i = 0; i < NODEMAP_COUNT; i++ )); do local csum=${HOSTNAME_CHECKSUM}_${i} @@ -516,12 +516,12 @@ squash_id() { } # ensure that the squash defaults are the expected defaults -squash_id default 99 0 +squash_id default ${NOBODY_UID:-65534} 0 wait_nm_sync default squash_uid '' inactive -squash_id default 99 1 +squash_id default ${NOBODY_UID:-65534} 1 wait_nm_sync default squash_gid '' inactive if [ "$MDS1_VERSION" -ge $(version_code 2.14.0.24) ]; then - squash_id default 99 2 + squash_id default ${NOBODY_UID:-65534} 2 wait_nm_sync default squash_projid '' inactive fi @@ -643,12 +643,12 @@ test_idmap() { fi done - ## check that root is mapped to 99 + ## check that root is mapped to NOBODY_UID for ((j = 0; j < NODEMAP_RANGE_COUNT; j++)); do nid="$SUBNET_CHECKSUM.0.${j}.100@tcp" fs_id=$(do_facet mgs $cmd --nid $nid --idtype uid --id 0) - if [ $fs_id != 99 ]; then - error "root squash expected 99, got $fs_id" + if [ $fs_id != $NOBODY_UID ]; then + error "root squash expected $NOBODY_UID, got $fs_id" rc=$((rc + 1)) fi done -- 1.8.3.1