Whamcloud - gitweb
LU-14808 utils: fix YAML support for DOM files 33/44133/3
authorVitaly Fertman <c17818@cray.com>
Tue, 15 Jun 2021 14:47:25 +0000 (17:47 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 12 Jul 2021 18:47:34 +0000 (18:47 +0000)
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 <c17818@cray.com>
HPE-bug-id: LUS-10090
Change-Id: Ide0c0fc264c7d1bac487306edf896d90153cf768
Reviewed-on: https://es-gerrit.dev.cray.com/158810
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Sergey Cheremencev <c17829@cray.com>
Tested-by: Jenkins Build User <nssreleng@cray.com>
Reviewed-on: https://review.whamcloud.com/44133
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-flr.sh
lustre/tests/sanity-pfl.sh
lustre/utils/lfs.c

index a0b6792..32f666e 100644 (file)
@@ -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
index edb11f8..36c72bd 100644 (file)
@@ -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
index 7db2850..3ca68d4 100644 (file)
@@ -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.