return 0;
}
+static int mdd_dom_data_truncate(const struct lu_env *env,
+ struct mdd_device *mdd, struct mdd_object *mo);
+
static int mdd_xattr_split(const struct lu_env *env, struct md_object *md_obj,
struct md_rejig_data *mrd)
{
struct lov_comp_md_v1 *lcm;
struct thandle *handle;
int rc;
+ bool dom_stripe = false;
+
ENTRY;
rc = lu_fid_cmp(mdo2fid(obj), mdo2fid(vic));
if (rc < 0)
GOTO(out, rc);
+ dom_stripe = mdd_lmm_dom_size(buf_vic->lb_buf) > 0;
+
rc = mdd_declare_xattr_set(env, mdd, obj, buf, XATTR_NAME_LOV,
LU_XATTR_SPLIT, handle);
if (rc)
mdd_obj_dev_name(obj), PFID(mdo2fid(obj)), rc2);
}
out:
- mdd_trans_stop(env, mdd, rc, handle);
+ rc = mdd_trans_stop(env, mdd, rc, handle);
+
+ /* Truncate local DOM data if all went well */
+ if (!rc && dom_stripe)
+ mdd_dom_data_truncate(env, mdd, obj);
+
mdd_write_unlock(env, obj);
mdd_write_unlock(env, vic);
lu_buf_free(buf_save);