rc = md_rename(mc->mc_desc.cl_exp, &mci->mci_opdata, NULL, 0,
name, strlen(name), &mci->mci_req);
+ if (rc == 0) {
+ /* get attr from request */
+ mdc_req2attr_update(ctx, ma);
+ }
ptlrpc_req_finished(mci->mci_req);
if (is_dir)
__mdd_ref_del(ctxt, mdd_spobj, handle);
- if (tobj) {
- rc = __mdd_index_delete(ctxt, mdd_tpobj, tname, handle);
- if (rc)
- GOTO(cleanup, rc);
- }
-
+ rc = __mdd_index_delete(ctxt, mdd_tpobj, tname, handle);
+ /* tobj can be remote one,
+ * so we do index_delete unconditionally and -ENOENT is allowed */
+ if (rc != 0 && rc != -ENOENT)
+ GOTO(cleanup, rc);
+
rc = __mdd_index_insert(ctxt, mdd_tpobj, lf, tname, is_dir, handle);
if (rc)
GOTO(cleanup, rc);