#define OBD_FAIL_LOV_MIRROR_INIT 0x1425
#define OBD_FAIL_LOV_COMP_MAGIC 0x1426
#define OBD_FAIL_LOV_COMP_PATTERN 0x1427
+#define OBD_FAIL_LOV_INVALID_OSTIDX 0x1428
#define OBD_FAIL_FID_INDIR 0x1501
#define OBD_FAIL_FID_INLMA 0x1502
* component, its l_ost_idx does not matter.
*/
objs[i].l_ost_idx = cpu_to_le32(ost_idx);
+
+ /* simulation of broken LOVEA */
+ if (CFS_FAIL_CHECK(OBD_FAIL_LOV_INVALID_OSTIDX) &&
+ comp_idx == 0 && i == 0 && lo->ldo_mirror_count > 1) {
+ objs[i].l_ost_idx = cpu_to_le32(0xffffffff);
+ }
+
}
done:
if (lmm_size != NULL)
LCME_FL_INIT,
(i == entry_count - 1) ? &maxbytes :
NULL);
- if (IS_ERR(lsme))
- GOTO(out_lsm, rc = PTR_ERR(lsme));
+ if (IS_ERR(lsme)) {
+ OBD_ALLOC_LARGE(lsme, sizeof(*lsme));
+ if (!lsme)
+ GOTO(out_lsm, rc = -ENOMEM);
+
+ lsme->lsme_magic = LOV_MAGIC_FOREIGN;
+ lsme->lsme_pattern = LOV_PATTERN_FOREIGN;
+ lsme->lsme_flags = LCME_FL_OFFLINE;
+ }
/**
* pressume that unrecognized magic component also has valid
}
run_test 209b "pagecache can be used after LL cancellation"
+test_210a() {
+ local tf=$DIR/$tfile
+
+ stack_trap "rm -f $tf"
+ dd if=/dev/zero of=$tf bs=1M count=1 || error "can't dd"
+#define OBD_FAIL_LOV_INVALID_OSTIDX 0x1428
+ do_facet mds1 "$LCTL set_param fail_loc=0x1428"
+ $LFS mirror extend -N $tf || error "can't mirror"
+ $LFS getstripe -v $tf
+ stat $tf || error "can't stat"
+}
+run_test 210a "handle broken mirrored lovea"
+
complete_test $SECONDS
check_and_cleanup_lustre
exit_status