From d46b5e15a0581183b0ee2e1a1c750f839b111f71 Mon Sep 17 00:00:00 2001 From: tappro Date: Mon, 18 Sep 2006 07:12:44 +0000 Subject: [PATCH] sanity test 24 fixes in CMD setup: - get attributes after remote operation - make index_delete(target_name) unconditionally in mdd_rename --- lustre/cmm/mdc_object.c | 4 ++++ lustre/mdd/mdd_handler.c | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lustre/cmm/mdc_object.c b/lustre/cmm/mdc_object.c index ff5ee14..0146a18 100644 --- a/lustre/cmm/mdc_object.c +++ b/lustre/cmm/mdc_object.c @@ -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); diff --git a/lustre/mdd/mdd_handler.c b/lustre/mdd/mdd_handler.c index 2da60a9..c8b0354 100644 --- a/lustre/mdd/mdd_handler.c +++ b/lustre/mdd/mdd_handler.c @@ -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); -- 1.8.3.1