From e8694658479dad1f951e9d9b9870195319872c27 Mon Sep 17 00:00:00 2001 From: Alexandre Ioffe Date: Wed, 27 Mar 2024 19:34:58 -0700 Subject: [PATCH] LU-17685 utils: Allow nocompr flag in lfs mirror extend Extend the set of allowed optional flags in 'lfs mirror extend' command by LCME_FL_NOCOMPR. Allowed syntax: --flags=prefer --flags=nocompr --flags=prefer,nocompr Lustre-change: https://review.whamcloud.com/54640 Lustre-commit: 37e1316050c93e5233f77ebcd399a8272b989605 Test-Parameters: trivial testlist=sanity-flr Signed-off-by: Alexandre Ioffe Change-Id: Id1538182eca0142464c19c0c4b1406592e615be1 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54593 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu --- lustre/include/uapi/linux/lustre/lustre_user.h | 2 +- lustre/tests/sanity-flr.sh | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lustre/include/uapi/linux/lustre/lustre_user.h b/lustre/include/uapi/linux/lustre/lustre_user.h index a069b0c..1bedab6 100644 --- a/lustre/include/uapi/linux/lustre/lustre_user.h +++ b/lustre/include/uapi/linux/lustre/lustre_user.h @@ -933,7 +933,7 @@ enum lov_comp_md_entry_flags { LCME_FL_EXTENSION) /* The mirror flags can be set by users at creation time. */ -#define LCME_USER_MIRROR_FLAGS (LCME_FL_PREF_RW) +#define LCME_USER_MIRROR_FLAGS (LCME_FL_PREF_RW | LCME_FL_NOCOMPR) /* The allowed flags obtained from the client at component creation time. */ #define LCME_CL_COMP_FLAGS (LCME_USER_MIRROR_FLAGS | LCME_FL_EXTENSION | \ diff --git a/lustre/tests/sanity-flr.sh b/lustre/tests/sanity-flr.sh index 9c06938..449ed4a3 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -4135,12 +4135,26 @@ function test_205() { $LFS mirror extend -N --flags=prefer $tf mirrors=$($LFS getstripe $tf | grep lcme_mirror_id | wc -l ) - (( $mirrors == 3 )) || error "no new mirror was created?" + (( $mirrors == 3 )) || error "no new mirror with prefer flag was created?" $($LFS getstripe $tf | grep lcme_flags: | tail -1 | grep -q prefer) || error "prefer flag was not set on the new mirror" + + $LFS mirror extend -N --flags=nocompr $tf + mirrors=$($LFS getstripe $tf | grep lcme_mirror_id | wc -l ) + (( $mirrors == 4 )) || error "no new mirror with nocompr flag was created?" + + $($LFS getstripe $tf | grep lcme_flags: | tail -1 | grep -q nocompr) || + error "nocompr flag was not set on the new mirror" + + $LFS mirror extend -N --flags=prefer,nocompr $tf + mirrors=$($LFS getstripe $tf | grep lcme_mirror_id | wc -l ) + (( $mirrors == 5 )) || error "no new mirror with prefer,nocompr flags was created?" + + $($LFS getstripe $tf | grep lcme_flags: | tail -1 | grep -q "prefer,nocompr") || + error "prefer,nocompr flags were not set on the new mirror" } -run_test 205 "lfs mirror extend to set prefer flag" +run_test 205 "lfs mirror extend to set prefer and nocompr flags" function test_206() { # create a new OST pool -- 1.8.3.1