Whamcloud - gitweb
- using __mdd_lookup_locked() in mdd_parent_fid();
authoryury <yury>
Fri, 13 Oct 2006 11:11:40 +0000 (11:11 +0000)
committeryury <yury>
Fri, 13 Oct 2006 11:11:40 +0000 (11:11 +0000)
- fixes in mdt_renew_capa() about using @body.

lustre/fld/fld_handler.c
lustre/mdd/mdd_handler.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_open.c

index 375982c..67f08d9 100644 (file)
@@ -165,9 +165,9 @@ static int fld_server_handle(struct lu_server_fld *fld,
                 break;
         }
         if (rc) {
-                CERROR("%s: FLD req (opc: %d, seq: "LPX64", mds: "
-                       LPU64") handle error %d\n", fld->lsf_name,
-                       opc, mf->mf_seq, mf->mf_mds, rc);
+                CERROR("%s: FLD req handle error %d (opc: %d, seq: "
+                       LPX64", mds: "LPU64")\n", fld->lsf_name, rc,
+                       opc, mf->mf_seq, mf->mf_mds);
         }
         RETURN(rc);
 
index a49f484..a848eea 100644 (file)
@@ -1841,7 +1841,8 @@ static int mdd_parent_fid(const struct lu_env *env,
                           struct mdd_object *obj,
                           struct lu_fid *fid)
 {
-        return __mdd_lookup(env, &obj->mod_obj, dotdot, fid, 0);
+        return __mdd_lookup_locked(env, &obj->mod_obj,
+                                   dotdot, fid, 0);
 }
 
 /*
@@ -1931,7 +1932,6 @@ static int mdd_rename_lock(const struct lu_env *env,
         }
 
         mdd_lock2(env, src_pobj, tgt_pobj);
-
         RETURN(0);
 }
 
@@ -2010,7 +2010,7 @@ static int mdd_rename(const struct lu_env *env,
         if (IS_ERR(handle))
                 RETURN(PTR_ERR(handle));
 
-        /*FIXME: Should consider tobj and sobj too in rename_lock*/
+        /* FIXME: Should consider tobj and sobj too in rename_lock. */
         rc = mdd_rename_lock(env, mdd, mdd_spobj, mdd_tpobj);
         if (rc)
                 GOTO(cleanup_unlocked, rc);
@@ -2025,8 +2025,10 @@ static int mdd_rename(const struct lu_env *env,
         if (rc)
                 GOTO(cleanup, rc);
 
-        /* tobj can be remote one,
-         * so we do index_delete unconditionally and -ENOENT is allowed */
+        /*
+         * Here tobj can be remote one, so we do index_delete unconditionally
+         * and -ENOENT is allowed.
+         */
         rc = __mdd_index_delete(env, mdd_tpobj, tname, is_dir, handle,
                                 mdd_object_capa(env, mdd_tpobj));
         if (rc != 0 && rc != -ENOENT)
@@ -2115,7 +2117,7 @@ __mdd_lookup(const struct lu_env *env, struct md_object *pobj,
 
         if (S_ISDIR(mdd_object_type(mdd_obj)) && dt_try_as_dir(env, dir))
                 rc = dir->do_index_ops->dio_lookup(env, dir, rec, key,
-                                                 mdd_object_capa(env, mdd_obj));
+                                                   mdd_object_capa(env, mdd_obj));
         else
                 rc = -ENOTDIR;
 
index b83642b..6f26e99 100644 (file)
@@ -432,13 +432,13 @@ static int mdt_renew_capa(struct mdt_thread_info *info)
         int rc;
         ENTRY;
 
+        body = req_capsule_server_get(&info->mti_pill, &RMF_MDT_BODY);
+        LASSERT(body != NULL);
+
         /* NB: see mdt_unpack_req_pack_rep */
         if (!obj)
                 GOTO(out, rc = -ENOENT);
 
-        body = req_capsule_server_get(&info->mti_pill, &RMF_MDT_BODY);
-        LASSERT(body);
-
         c = req_capsule_client_get(&info->mti_pill, &RMF_CAPA1);
         LASSERT(c);
 
index ac4968c..ebc3b0b 100644 (file)
@@ -783,6 +783,7 @@ int mdt_reint_open(struct mdt_thread_info *info, struct mdt_lock_handle *lhc)
                 mdt_set_disposition(info, ldlm_rep, DISP_LOOKUP_POS);
         }
 
+        LASSERT(fid_is_sane(child_fid));
         child = mdt_object_find(info->mti_env, mdt, child_fid);
         if (IS_ERR(child))
                 GOTO(out_parent, result = PTR_ERR(child));