Whamcloud - gitweb
sanity test 24 fixes in CMD setup:
authortappro <tappro>
Mon, 18 Sep 2006 07:12:44 +0000 (07:12 +0000)
committertappro <tappro>
Mon, 18 Sep 2006 07:12:44 +0000 (07:12 +0000)
- get attributes after remote operation
- make index_delete(target_name) unconditionally in mdd_rename

lustre/cmm/mdc_object.c
lustre/mdd/mdd_handler.c

index ff5ee14..0146a18 100644 (file)
@@ -325,6 +325,10 @@ static int mdc_rename_tgt(const struct lu_context *ctx,
 
         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);
 
index 2da60a9..c8b0354 100644 (file)
@@ -1511,12 +1511,12 @@ static int mdd_rename(const struct lu_context *ctxt, struct md_object *src_pobj,
         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);