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);
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)