From ab1c085b033016b15e7b4dab48b38f9365d0adff Mon Sep 17 00:00:00 2001 From: tappro Date: Thu, 24 Aug 2006 22:42:53 +0000 Subject: [PATCH] - fix invalid conditon during check that fid2 is valid - do lock_decref only if rc != 0 - set special policy for mkdir to test croff-ref cases --- lustre/lmv/lmv_intent.c | 6 ++---- lustre/lmv/lmv_obd.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lustre/lmv/lmv_intent.c b/lustre/lmv/lmv_intent.c index bdb7be4..97edb0e 100644 --- a/lustre/lmv/lmv_intent.c +++ b/lustre/lmv/lmv_intent.c @@ -130,7 +130,7 @@ int lmv_intent_remote(struct obd_export *exp, void *lmm, OBD_FREE_PTR(op_data); EXIT; out: - if (pmode) + if (rc && pmode) ldlm_lock_decref(&plock, pmode); ptlrpc_req_finished(*reqp); @@ -707,7 +707,6 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data, int extra_lock_flags) { struct obd_device *obd = exp->exp_obd; - struct lmv_obd *lmv = &obd->u.lmv; const char *name = op_data->name; int len = op_data->namelen; struct lu_fid *pid, *cid; @@ -719,8 +718,7 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data, pid = &op_data->fid1; - cid = !fid_is_sane(&op_data->fid2) ? - &op_data->fid2 : NULL; + cid = fid_is_sane(&op_data->fid2) ? &op_data->fid2 : NULL; CDEBUG(D_OTHER, "INTENT LOCK '%s' for '%*s' on "DFID"\n", LL_IT2STR(it), len, name, PFID(pid)); diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index c71381f..901fdb4 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -675,9 +675,17 @@ static int lmv_placement_policy(struct obd_device *obd, * balanced, that is all sequences have more or less equal * number of objects created. */ if (hint->ph_cname && (hint->ph_opc == LUSTRE_OPC_MKDIR)) { +#if 0 *mds = lmv_all_chars_policy(lmv->desc.ld_tgt_count, hint->ph_cname); rc = 0; +#else + /* stress policy for tests - to use non-parent MDS */ + LASSERT(fid_is_sane(hint->ph_pfid)); + rc = lmv_fld_lookup(lmv, hint->ph_pfid, mds); + *mds = (int)(*mds + 1) % lmv->desc.ld_tgt_count; + +#endif } else { /* default policy is to use parent MDS */ LASSERT(fid_is_sane(hint->ph_pfid)); @@ -1963,10 +1971,10 @@ static int lmv_unlink(struct obd_export *exp, struct md_op_data *op_data, op_data->name, op_data->namelen); op_data->fid1 = obj->lo_inodes[i].li_fid; lmv_obj_put(obj); + CDEBUG(D_OTHER, "unlink '%*s' in "DFID" -> %u\n", + op_data->namelen, op_data->name, + PFID(&op_data->fid1), i); } - CDEBUG(D_OTHER, "unlink '%*s' in "DFID" -> %u\n", - op_data->namelen, op_data->name, PFID(&op_data->fid1), - i); } else { CDEBUG(D_OTHER, "drop i_nlink on "DFID"\n", PFID(&op_data->fid1)); -- 1.8.3.1