struct mdd_device *mdd = mdo2mdd(src_pobj);
struct mdd_object *mdd_spobj = md2mdd_obj(src_pobj);
struct mdd_object *mdd_tpobj = md2mdd_obj(tgt_pobj);
- struct mdd_object *mdd_sobj = mdd_object_find(ctxt, mdd, lf);
+ struct mdd_object *mdd_sobj = NULL;
struct mdd_object *mdd_tobj = NULL;
struct lu_attr *la_copy = &mdd_ctx_info(ctxt)->mti_la_for_fix;
struct thandle *handle;
if (rc)
GOTO(cleanup, rc);
+ mdd_sobj = mdd_object_find(ctxt, mdd, lf);
*la_copy = ma->ma_attr;
la_copy->la_valid = LA_CTIME;
if (mdd_sobj) {
}
/* handle last link of tgt object */
- if (mtgt)
+ if (rc == 0 && mtgt)
mdt_handle_last_unlink(info, mtgt, ma);
- GOTO(out_unlock_tgt, rc);
-
+ EXIT;
out_unlock_tgt:
if (mtgt) {
mdt_object_unlock_put(info, mtgt, lh_tgt, rc);
(mnew ? mdt_object_child(mnew) : NULL), rr->rr_tgt, ma);
/* handle last link of tgt object */
- if (mnew)
+ if (rc == 0 && mnew)
mdt_handle_last_unlink(info, mnew, ma);
out_unlock_new: