__u32 magic, pattern;
__u16 mirror_cnt = 0;
__u16 comp_cnt;
+ __u64 dom_size = 0;
int i, rc;
__u16 mirror_id = MIRROR_ID_NEG;
bool stale = false;
if (!lov_pattern_supported(lov_pattern(pattern)))
GOTO(out, rc = -EINVAL);
+ if (pattern & LOV_PATTERN_MDT) {
+ if (lod_comp->llc_extent.e_start != 0) {
+ CERROR("%s: DOM entry must be the first stripe "
+ "in a mirror\n", lod2obd(d)->obd_name);
+ GOTO(out, rc = -EINVAL);
+ }
+ if (!dom_size) {
+ dom_size = lod_comp->llc_extent.e_end;
+ } else if (dom_size != lod_comp->llc_extent.e_end) {
+ CERROR("%s: DOM entries with different sizes "
+ "%#llx/%#llx\n", lod2obd(d)->obd_name,
+ dom_size, lod_comp->llc_extent.e_end);
+ GOTO(out, rc = -EINVAL);
+ }
+ }
+
lod_comp->llc_pattern = pattern;
lod_comp->llc_stripe_size = le32_to_cpu(lmm->lmm_stripe_size);
lod_comp->llc_stripe_count = le16_to_cpu(lmm->lmm_stripe_count);
}
run_test 5 "Make sure init size work for mirrored layout"
-test_6() {
+test_6a() {
(( $MDS1_VERSION >= $(version_code 2.12.58) )) ||
skip "MDS version older than 2.12.58"
$LFS mirror extend -N -f $tf-1 $tf-2 ||
error "failure to extend mirrored file with DoM extent"
}
-run_test 6 "DoM and FLR work together"
+run_test 6a "DoM and FLR work together"
+
+test_6b() {
+ (( $MDS1_VERSION >= $(version_code 2.15.58.1) )) ||
+ skip "MDS version older than 2.15.58.1"
+
+ local tf=$DIR/$tfile
+
+ $LFS setstripe -E64K -L mdt -Eeof $tf ||
+ error "failure to create PFL with DoM file"
+ $LFS mirror extend -N -E1M -L mdt -Eeof $tf &&
+ error "should not extend mirror with different DoM size"
+
+ return 0
+}
+run_test 6b "extend mirror with different DoM size"
test_7() {
local tf=$DIR/$tfile