Whamcloud - gitweb
LU-5710 all: second batch of corrected typos and grammar errors
[fs/lustre-release.git] / lustre / mdd / mdd_dir.c
index 92b3e8f..9d03d17 100644 (file)
@@ -205,7 +205,7 @@ out:
  * No permission check is needed.
  *
  * returns 1: if fid is ancestor of @mo;
- * returns 0: if fid is not a ancestor of @mo;
+ * returns 0: if fid is not an ancestor of @mo;
  *
  * returns EREMOTE if remote object is found, fid of remote object is saved to
  * @fid;
@@ -3603,13 +3603,6 @@ static int mdd_migrate_entries(const struct lu_env *env,
                                                name, handle);
                        if (rc != 0)
                                GOTO(out_put, rc);
-
-                       if (is_dir) {
-                               rc = mdo_ref_add(env, mdd_tobj, handle);
-                               if (rc != 0)
-                                       GOTO(out_put, rc);
-
-                       }
                }
 
                rc = __mdd_index_delete(env, mdd_sobj, name, is_dir, handle);
@@ -3724,6 +3717,10 @@ static int mdd_declare_migrate_update_name(const struct lu_env *env,
        if (rc != 0)
                return rc;
 
+       rc = mdd_declare_links_add(env, mdd_tobj, handle, NULL, MLAO_IGNORE);
+       if (rc != 0)
+               return rc;
+
        if (S_ISDIR(mdd_object_type(mdd_sobj))) {
                rc = mdo_declare_ref_add(env, mdd_pobj, handle);
                if (rc != 0)