Whamcloud - gitweb
LU-14480 pool: wrong usage with ost list 15/41815/3
authorVitaly Fertman <c17818@cray.com>
Wed, 16 Dec 2020 22:02:32 +0000 (01:02 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 22 Mar 2021 16:25:41 +0000 (16:25 +0000)
When the OST list is given on setstripe, it should have a priority
over the pool. Also, we check only for the 1st OST if it is in the
pool at the creation time, what worked well in past with -c and
works even with -C, but not with the OST list when some of the OSTs
are out of the pool.

Make the --pool and --ost options mutualy exclusive.
Drop the pool inheritance if the OST list is given.

Signed-off-by: Vitaly Fertman <c17818@cray.com>
Change-Id: I94a7fe97391f1185392f986f78ab1a372238972a
Reviewed-on: https://es-gerrit.dev.cray.com/158198
HPE-bug-id: LUS-9579
Reviewed-by: Alexander Boyko <c17825@cray.com>
Reviewed-by: Andriy Skulysh <c17819@cray.com>
Tested-by: Elena Gryaznova <c17455@cray.com>
Reviewed-on: https://review.whamcloud.com/41815
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Andriy Skulysh <askulysh@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lod/lod_qos.c
lustre/tests/sanity-flr.sh

index 40376a0..fa5903e 100644 (file)
@@ -2242,9 +2242,13 @@ int lod_qos_parse_config(const struct lu_env *env, struct lod_object *lo,
                }
 
                pool_name = NULL;
+               if (def_pool[0] != '\0')
+                       pool_name = def_pool;
+
                if (v1->lmm_magic == LOV_USER_MAGIC_V3 ||
                    v1->lmm_magic == LOV_USER_MAGIC_SPECIFIC) {
                        v3 = (struct lov_user_md_v3 *)v1;
+
                        if (v3->lmm_pool_name[0] != '\0')
                                pool_name = v3->lmm_pool_name;
 
@@ -2252,12 +2256,11 @@ int lod_qos_parse_config(const struct lu_env *env, struct lod_object *lo,
                                rc = lod_comp_copy_ost_lists(lod_comp, v3);
                                if (rc)
                                        GOTO(free_comp, rc);
+
+                               pool_name = NULL;
                        }
                }
 
-               if (pool_name == NULL && def_pool[0] != '\0')
-                       pool_name = def_pool;
-
                if (v1->lmm_pattern == 0)
                        v1->lmm_pattern = LOV_PATTERN_RAID0;
                if (lov_pattern(v1->lmm_pattern) != LOV_PATTERN_RAID0 &&
index 2ee60c8..b8cdf86 100644 (file)
@@ -378,7 +378,6 @@ test_0b() {
        verify_comp_attr stripe-size $tf ${ids[1]} 4194304
        verify_comp_attr stripe-count $tf ${ids[1]} 2
        verify_comp_attr stripe-index $tf ${ids[1]} 2
-       verify_comp_attr pool $tf ${ids[1]} flash
 
        # verify component ${ids[2]}
        verify_comp_attr stripe-size $tf ${ids[2]} 16777216
@@ -450,7 +449,6 @@ test_0c() {
                verify_comp_attr_with_default stripe-size $tf ${ids[$i]}
                verify_comp_attr stripe-count $tf ${ids[$i]} 2
                verify_comp_attr stripe-index $tf ${ids[$i]} 1
-               verify_comp_attr pool $tf ${ids[$i]} flash
                verify_comp_extent $tf ${ids[$i]} 0 4194304
        done
 
@@ -566,13 +564,11 @@ test_0e() {
        verify_comp_attr stripe-size $tf ${ids[0]} 33554432
        verify_comp_attr stripe-count $tf ${ids[0]} 3
        verify_comp_attr stripe-index $tf ${ids[0]} 1
-       verify_comp_attr pool $tf ${ids[0]} ssd
 
        # verify component ${ids[1]}
        verify_comp_attr stripe-size $tf ${ids[1]} 4194304
        verify_comp_attr stripe-count $tf ${ids[1]} 2
        verify_comp_attr stripe-index $tf ${ids[1]} 2
-       verify_comp_attr pool $tf ${ids[1]} flash
 
        # verify component ${ids[2]}
        verify_comp_attr stripe-size $tf ${ids[2]} 16777216
@@ -644,7 +640,6 @@ test_0f() {
                verify_comp_attr_with_default stripe-size $tf ${ids[$i]}
                verify_comp_attr stripe-count $tf ${ids[$i]} 2
                verify_comp_attr stripe-index $tf ${ids[$i]} 1
-               verify_comp_attr pool $tf ${ids[$i]} flash
                verify_comp_extent $tf ${ids[$i]} 0 4194304
        done