From b384ea39e593cda1ac4d6fb8b955d0c7d1a1f67b Mon Sep 17 00:00:00 2001 From: Vitaly Fertman Date: Thu, 17 Dec 2020 01:02:32 +0300 Subject: [PATCH] LU-14480 pool: wrong usage with ost list 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 Change-Id: I94a7fe97391f1185392f986f78ab1a372238972a Reviewed-on: https://es-gerrit.dev.cray.com/158198 HPE-bug-id: LUS-9579 Reviewed-by: Alexander Boyko Reviewed-by: Andriy Skulysh Tested-by: Elena Gryaznova Reviewed-on: https://review.whamcloud.com/41815 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Alexander Boyko Reviewed-by: Andriy Skulysh Reviewed-by: Oleg Drokin --- lustre/lod/lod_qos.c | 9 ++++++--- lustre/tests/sanity-flr.sh | 5 ----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index 40376a0..fa5903e 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -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 && diff --git a/lustre/tests/sanity-flr.sh b/lustre/tests/sanity-flr.sh index 2ee60c8..b8cdf86 100644 --- a/lustre/tests/sanity-flr.sh +++ b/lustre/tests/sanity-flr.sh @@ -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 -- 1.8.3.1