From 48f8978e6e7571ef6c9772ab82a40ed5466bc0b7 Mon Sep 17 00:00:00 2001 From: Vitaly Fertman Date: Tue, 15 Jun 2021 17:47:25 +0300 Subject: [PATCH] LU-14808 utils: fix YAML support for DOM files LFS getstripe never reports LLAPI_LAYOUT_DEFAULT for any stripe parameter, but 0 or -1 whatever is appropriate. LU-3285 added extra verification for the DOM parameters, precisely the stripe count, size and offset have no sense for DOM and are expected to be LLAPI_LAYOUT_DEFAULT. However, this brakes the yaml support which uses getstripe output as the wanted values. Also move the sanity-flr test_6 to ALWAYS_EXCEPT due to LU-14818. Fixes: 6744eb8eeb ("LU-3285 lfs: add parameter for Data-on-MDT file") Signed-off-by: Vitaly Fertman HPE-bug-id: LUS-10090 Change-Id: Ide0c0fc264c7d1bac487306edf896d90153cf768 Reviewed-on: https://es-gerrit.dev.cray.com/158810 Reviewed-by: Alexander Boyko Reviewed-by: Sergey Cheremencev Tested-by: Jenkins Build User Reviewed-on: https://review.whamcloud.com/44133 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Sergey Cheremencev Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- lustre/tests/sanity-flr.sh | 4 ++-- lustre/tests/sanity-pfl.sh | 31 +++++++++++++++++++++++++++++++ lustre/utils/lfs.c | 8 ++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/lustre/tests/sanity-flr.sh b/lustre/tests/sanity-flr.sh index a0b6792..32f666e 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -14,8 +14,8 @@ init_test_env $@ init_logging ALWAYS_EXCEPT="$SANITY_FLR_EXCEPT " -# Bug number for skipped test: LU-11381 -ALWAYS_EXCEPT+=" 201 " +# Bug number for skipped test: LU-14818 LU-11381 +ALWAYS_EXCEPT+=" 6 201 " # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT! # skip all tests for PPC until we can get sanity-pfl to pass diff --git a/lustre/tests/sanity-pfl.sh b/lustre/tests/sanity-pfl.sh index edb11f8..36c72bd 100644 --- a/lustre/tests/sanity-pfl.sh +++ b/lustre/tests/sanity-pfl.sh @@ -1017,6 +1017,37 @@ test_16c() { } run_test 16c "Verify setstripe/getstripe for SEL layout with YAML config file" +test_16d() { + [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" + + local file=$DIR/$tdir/$tfile + local dir=$DIR/$tdir/dir + local temp=$DIR/$tdir/template + rm -rf $DIR/$tdir + test_mkdir $DIR/$tdir + + ##################################################################### + # 1. DOM file + # set stripe for source file + $LFS setstripe -E1m -L mdt -E-1 -o1,0 $file || + error "Create $file failed" + + echo "1. DOM file" + verify_yaml_layout $file $file.copy $temp "1. DOM file" + + ##################################################################### + # 2. DOM dir + # set stripe for source dir + test_mkdir $dir + $LFS setstripe -E1m -L mdt -E-1 -o1,0 $dir || error "Create $dir failed" + + test_mkdir $dir.copy + echo "2. DOM dir" + verify_yaml_layout $dir $dir.copy $temp.dir "2. DOM dir" +} +run_test 16d "Verify setstripe/getstripe for DOM layout with YAML config file" + + test_17() { [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" local file=$DIR/$tdir/$tfile diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 7db2850..3ca68d4 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -2799,6 +2799,14 @@ new_comp: /* Data-on-MDT component setting */ if (lsa->lsa_pattern == LLAPI_LAYOUT_MDT) { + /* Yaml support */ + if (lsa->lsa_stripe_count == 0) + lsa->lsa_stripe_count = LLAPI_LAYOUT_DEFAULT; + if (lsa->lsa_stripe_size == lsa->lsa_comp_end) + lsa->lsa_stripe_size = LLAPI_LAYOUT_DEFAULT; + if (lsa->lsa_stripe_off == -1 || + lsa->lsa_stripe_off == 0) + lsa->lsa_stripe_off = LLAPI_LAYOUT_DEFAULT; /* * In case of Data-on-MDT patterns the only extra option * applicable is stripe size option. -- 1.8.3.1