struct lov_object *lov,
union lov_layout_state *state)
{
- lov->u = *state;
}
static struct cl_object *lov_sub_find(const struct lu_env *env,
struct lov_oinfo *oinfo;
int result;
+ if (OBD_FAIL_CHECK(OBD_FAIL_LOV_INIT)) {
+ cl_object_put(env, stripe);
+ return -EIO;
+ }
+
hdr = cl_object_header(lov2cl(lov));
subhdr = cl_object_header(stripe);
parent = subhdr->coh_parent;
ENTRY;
dump_lsm(D_INODE, lsm);
- if (cfs_atomic_read(&lsm->lsm_refc) > 1)
+ if (lov->lo_lsm_invalid && cfs_atomic_read(&lsm->lsm_refc) > 1)
RETURN(-EBUSY);
if (r0->lo_sub != NULL) {
const struct cl_object_conf *conf)
{
int result;
- union lov_layout_state *state = &lov_env_info(env)->lti_state;
+ union lov_layout_state *state = &lov->u;
const struct lov_layout_operations *old_ops;
const struct lov_layout_operations *new_ops;
LASSERT(hdr->coh_tree.rnode == NULL);
LASSERT(hdr->coh_pages == 0);
+ lov->lo_type = LLT_EMPTY;
result = new_ops->llo_init(env,
lu2lov_dev(lov->lo_cl.co_lu.lo_dev),
lov, conf, state);
if (result == 0) {
new_ops->llo_install(env, lov, state);
lov->lo_type = llt;
+ } else {
+ new_ops->llo_delete(env, lov, state);
+ new_ops->llo_fini(env, lov, state);
+ /* this file becomes an EMPTY file. */
}
}
RETURN(result);
struct lov_device *dev = lu2lov_dev(obj->lo_dev);
struct lov_object *lov = lu2lov(obj);
const struct cl_object_conf *cconf = lu2cl_conf(conf);
- union lov_layout_state *set = &lov_env_info(env)->lti_state;
+ union lov_layout_state *set = &lov->u;
const struct lov_layout_operations *ops;
int result;
result = ops->llo_init(env, dev, lov, cconf, set);
if (result == 0)
ops->llo_install(env, lov, set);
- else
- ops->llo_fini(env, lov, set);
RETURN(result);
}
}
run_test 205 "Verify job stats"
+# LU-1480, LU-1773 and LU-1657
+test_206() {
+ mkdir -p $DIR/$tdir
+ lfs setstripe -c -1 $DIR/$tdir
+#define OBD_FAIL_LOV_INIT 0x1403
+ $LCTL set_param fail_loc=0xa0001403
+ $LCTL set_param fail_val=1
+ touch $DIR/$tdir/$tfile || true
+}
+run_test 206 "fail lov_init_raid0() doesn't lbug"
+
test_212() {
size=`date +%s`
size=$((size % 8192 + 1))