From: Bobi Jam Date: Fri, 14 Apr 2017 08:06:34 +0000 (+0800) Subject: LU-9342 pfl: handle uninited component in user defined LOVEA X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2c031f6651a5be4f8c5b58f986b584d7821b0f2b;p=fs%2Flustre-release.git LU-9342 pfl: handle uninited component in user defined LOVEA It is possible that user defined LOVEA contains uninstantiated flag like replay of create or layout extend or lfs swap, the partial LOVEA will passed into lod_declare_xattr_set()->lod_declare_striped_object()-> lod_prepare_create()->lod_qos_parse_config()-> lod_use_defined_striping(), so that lod_use_defined_striping() also need to take care of uninstantiated component entry. Signed-off-by: Bobi Jam Change-Id: I45d46b118bcde66f4604b80e2da51a808f381219 Reviewed-on: https://review.whamcloud.com/26635 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jinshan Xiong --- diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index 89850ab..dcff9c1 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -1788,9 +1788,16 @@ int lod_use_defined_striping(const struct lu_env *env, lod_comp->llc_stripe_size = le32_to_cpu(v1->lmm_stripe_size); lod_comp->llc_stripenr = le16_to_cpu(v1->lmm_stripe_count); lod_comp->llc_layout_gen = le16_to_cpu(v1->lmm_layout_gen); + /** + * The stripe_offset of an uninit-ed component is stored in + * the lmm_layout_gen. + */ + if (mo->ldo_is_composite && !lod_comp_inited(lod_comp)) + lod_comp->llc_stripe_offset = lod_comp->llc_layout_gen; lod_obj_set_pool(mo, i, pool_name); - if (!(lod_comp->llc_pattern & LOV_PATTERN_F_RELEASED)) { + if ((!mo->ldo_is_composite || lod_comp_inited(lod_comp)) && + !(lod_comp->llc_pattern & LOV_PATTERN_F_RELEASED)) { rc = lod_initialize_objects(env, mo, objs, i); if (rc) GOTO(out, rc); diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 33268f1..9860653 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -11840,14 +11840,16 @@ test_184d() { error "create $file2 failed" $OPENFILE -f O_CREAT:O_LOV_DELAY_CREATE $file3 || error "create $file3 failed" - lovea1=$($LFS getstripe $file1 | sed 1d) + lovea1=$(get_layout_param $file1) $LFS swap_layouts $file2 $file3 || error "swap $file2 $file3 layouts failed" $LFS swap_layouts $file1 $file2 || error "swap $file1 $file2 layouts failed" - lovea2=$($LFS getstripe $file2 | sed 1d) + lovea2=$(get_layout_param $file2) + echo "$lovea1" + echo "$lovea2" [ "$lovea1" == "$lovea2" ] || error "lovea $lovea1 != $lovea2" lovea1=$(getfattr -n trusted.lov $file1 | grep ^trusted)