From 9ad595f6b148191d28f7168488b201ed9a23fd2c Mon Sep 17 00:00:00 2001 From: yury Date: Fri, 13 Oct 2006 11:11:40 +0000 Subject: [PATCH] - using __mdd_lookup_locked() in mdd_parent_fid(); - fixes in mdt_renew_capa() about using @body. --- lustre/fld/fld_handler.c | 6 +++--- lustre/mdd/mdd_handler.c | 14 ++++++++------ lustre/mdt/mdt_handler.c | 6 +++--- lustre/mdt/mdt_open.c | 1 + 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lustre/fld/fld_handler.c b/lustre/fld/fld_handler.c index 375982c..67f08d9 100644 --- a/lustre/fld/fld_handler.c +++ b/lustre/fld/fld_handler.c @@ -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); diff --git a/lustre/mdd/mdd_handler.c b/lustre/mdd/mdd_handler.c index a49f484..a848eea 100644 --- a/lustre/mdd/mdd_handler.c +++ b/lustre/mdd/mdd_handler.c @@ -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; diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index b83642b..6f26e99 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -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); diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index ac4968c..ebc3b0b 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -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)); -- 1.8.3.1