Whamcloud - gitweb
LU-12055 lod: ignore root layout if parent's one includes pool 86/34386/6
authorVladimir Saveliev <c17830@cray.com>
Fri, 8 Mar 2019 22:32:06 +0000 (01:32 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 30 Apr 2019 03:37:39 +0000 (03:37 +0000)
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 <c17830@cray.com>
Cray-bug-id: LUS-7093
Change-Id: Ib0f61edf4973bcb260dad617c27d1c1729223fa0
Reviewed-on: https://review.whamcloud.com/34386
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
lustre/lod/lod_object.c
lustre/tests/sanity.sh

index aed60a8..0b4a789 100644 (file)
@@ -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)
index e8a2ce9..8724c8f 100755 (executable)
@@ -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