From 125abdacbb50e19ff5cb0d0b9ef7449c9f000d70 Mon Sep 17 00:00:00 2001 From: huanghua Date: Sun, 17 Sep 2006 18:13:37 +0000 Subject: [PATCH] put object in mdd_rename and cml_rename. --- lustre/cmm/cmm_object.c | 10 ++++++---- lustre/mdd/mdd_handler.c | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lustre/cmm/cmm_object.c b/lustre/cmm/cmm_object.c index 420a86f..f2cefea 100644 --- a/lustre/cmm/cmm_object.c +++ b/lustre/cmm/cmm_object.c @@ -444,7 +444,7 @@ static int cml_rename(const struct lu_context *ctx, struct md_object *mo_po, /* get type from src, can be remote req */ rc = mo_attr_get(ctx, md_object_next(mo_s), tmp_ma); if (rc != 0) - RETURN(rc); + GOTO(out, rc); ma->ma_attr.la_mode = tmp_ma->ma_attr.la_mode; @@ -452,15 +452,17 @@ static int cml_rename(const struct lu_context *ctx, struct md_object *mo_po, /* mo_t is remote object and there is RPC to unlink it */ rc = mo_ref_del(ctx, md_object_next(mo_t), ma); if (rc) - RETURN(rc); + GOTO(out, rc); mo_t = NULL; } /* local rename, mo_t can be NULL */ rc = mdo_rename(ctx, md_object_next(mo_po), md_object_next(mo_pn), lf, s_name, md_object_next(mo_t), t_name, ma); - - RETURN(rc); + EXIT; +out: + lu_object_put(ctx, &mo_s->mo_lu); + return rc; } static int cml_rename_tgt(const struct lu_context *ctx, diff --git a/lustre/mdd/mdd_handler.c b/lustre/mdd/mdd_handler.c index 651574e..0508963 100644 --- a/lustre/mdd/mdd_handler.c +++ b/lustre/mdd/mdd_handler.c @@ -1561,6 +1561,7 @@ cleanup: mdd_rename_unlock(ctxt, mdd_spobj, mdd_tpobj); cleanup_unlocked: mdd_trans_stop(ctxt, mdd, rc, handle); + mdd_object_put(ctxt, mdd_sobj); RETURN(rc); } -- 1.8.3.1