From 670d78952901183012ae08f2b5e9374d6e293bcf Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Fri, 28 May 2021 16:25:52 +0800 Subject: [PATCH] LU-10350 lod: adjust stripe count to available ost count * In ost-pool.sh, reset $MOUNT's stripe offset, so that the created directory will not inherit it from root directory. * Preserve the root directory layout in replay-single (run before ost-pools) to avoid leaving a bad layout on the root dir. Lustre-change: https://review.whamcloud.com/43872 Lustre-change: https://review.whamcloud.com/43882 Lustre-commit: TBD (from c82f557324bc0048c308d1a2135699e7c83169e1) Test-Parameters: trivial testlist=replay-single,ost-pools Signed-off-by: Bobi Jam Change-Id: Idf6884faf1271a3864710aeab0ba0eca154bf492 Reviewed-on: https://review.whamcloud.com/43976 Reviewed-by: James Nunez Tested-by: jenkins Reviewed-by: Bobi Jam Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/tests/ost-pools.sh | 6 +++++- lustre/tests/replay-single.sh | 20 ++++++++++---------- lustre/tests/sanity.sh | 3 +-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lustre/tests/ost-pools.sh b/lustre/tests/ost-pools.sh index ba6529e..9435185 100755 --- a/lustre/tests/ost-pools.sh +++ b/lustre/tests/ost-pools.sh @@ -72,7 +72,7 @@ create_dir() { if [[ -n $idx ]]; then $LFS setstripe -c $count -p $pool -i $idx $dir else - $LFS setstripe -c $count -p $pool $dir + $LFS setstripe -c $count -p $pool -i -1 $dir fi [[ $? -eq 0 ]] || error "$LFS setstripe -p $pool $dir failed" [[ "$($LFS getstripe --pool $dir)" == "$pool" ]] || @@ -220,6 +220,10 @@ ost_pools_init() { remote_mds_nodsh && skip "remote MDS with nodsh" remote_ost_nodsh && skip "remote OST with nodsh" ost_pools_init +# reset root directory's stripe offset +$LFS getstripe -d $MOUNT +save_layout_restore_at_exit $MOUNT +$LFS setstripe -i -1 $MOUNT # Tests for new commands added test_1a() { diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 12bd433..7d5601d 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -481,6 +481,7 @@ test_20b() { # bug 10480 local n_attempts=1 sync_all_data + save_layout_restore_at_exit $MOUNT $LFS setstripe -i 0 -c 1 $DIR local beforeused=$(df -P $DIR | tail -1 | awk '{ print $3 }') @@ -3342,16 +3343,15 @@ cleanup_90 () { } test_90() { # bug 19494 - local dir=$DIR/$tdir - local ostfail=$(get_random_entry $(get_facets OST)) - - if [[ $FAILURE_MODE = HARD ]]; then - local affected=$(affected_facets $ostfail); - if [[ "$affected" != $ostfail ]]; then - skip not functional with FAILURE_MODE=$FAILURE_MODE, affected: $affected - return 0 - fi - fi + local dir=$DIR/$tdir + local ostfail=$(get_random_entry $(get_facets OST)) + + if [[ $FAILURE_MODE = HARD ]]; then + local affected=$(affected_facets $ostfail); + + [[ "$affected" == $ostfail ]] || + skip "cannot use FAILURE_MODE=$FAILURE_MODE, affected: $affected" + fi # ensure all OSTs are active to allow allocations wait_osts_up diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 5fc5034..3f353ff 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -7420,8 +7420,7 @@ test_65n() { which getfattr > /dev/null 2>&1 || skip_env "no getfattr command" which setfattr > /dev/null 2>&1 || skip_env "no setfattr command" - local root_layout=$(save_layout $MOUNT) - stack_trap "restore_layout $MOUNT $root_layout" EXIT + save_layout_restore_at_exit $MOUNT # new subdirectory under root directory should not inherit # the default layout from root -- 1.8.3.1