From: Vladimir Saveliev Date: Fri, 8 Mar 2019 22:32:06 +0000 (+0300) Subject: LU-12055 lod: ignore root layout if parent's one includes pool X-Git-Tag: 2.12.53~15 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=d8b08f467de92664e116b068abfc0c250ea66a62 LU-12055 lod: ignore root layout if parent's one includes pool When parent directory provides striping information which includes a pool, don't inherit the stripe index from the root directory striping. Otherwise, pool config and root layout mismatch leads to create failure. Test illustrating the issue is added. Fix for sanity.sh:test_255c: the test assumes that test dir has stripe count set to 1. Specify it explicitly to avoid using stripe count of root directory which might be not 1. Signed-off-by: Vladimir Saveliev Cray-bug-id: LUS-7093 Change-Id: Ib0f61edf4973bcb260dad617c27d1c1729223fa0 Reviewed-on: https://review.whamcloud.com/34386 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Jian Yu --- diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index aed60a8..0b4a789 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -4876,7 +4876,8 @@ static void lod_ah_init(const struct lu_env *env, if (lod_comp->llc_stripe_size <= 0) lod_comp->llc_stripe_size = def_comp->llc_stripe_size; - if (lod_comp->llc_stripe_offset == LOV_OFFSET_DEFAULT) + if (lod_comp->llc_stripe_offset == LOV_OFFSET_DEFAULT && + (!lod_comp->llc_pool || !lod_comp->llc_pool[0])) lod_comp->llc_stripe_offset = def_comp->llc_stripe_offset; if (lod_comp->llc_pool == NULL) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index e8a2ce9..8724c8f 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2375,6 +2375,23 @@ test_27H() { } run_test 27H "Set specific OSTs stripe" +test_27I() { + [ $PARALLEL == "yes" ] && skip "skip parallel run" + [[ $OSTCOUNT -lt 2 ]] && skip_env "needs >= 2 OSTs" + local pool=$TESTNAME + local ostrange="1 1 1" + + save_layout_restore_at_exit $MOUNT + $LFS setstripe -c 2 -i 0 $MOUNT + pool_add $pool || error "pool_add failed" + pool_add_targets $pool $ostrange || "pool_add_targets failed" + test_mkdir $DIR/$tdir + $LFS setstripe -p $pool $DIR/$tdir + $MULTIOP $DIR/$tdir/$tfile Oc || error "multiop failed" + $LFS getstripe $DIR/$tdir/$tfile +} +run_test 27I "check that root dir striping does not break parent dir one" + # createtest also checks that device nodes are created and # then visible correctly (#2091) test_28() { # bug 2091 @@ -16845,7 +16862,7 @@ test_255c() { local rc test_mkdir -p $DIR/$tdir - $LFS setstripe -i 0 $DIR/$tdir + $LFS setstripe -i 0 -c 1 $DIR/$tdir #test 10 returns only success/failure i=10