From 1c4d44868824ad70a0712a01b0175ff65b2dd435 Mon Sep 17 00:00:00 2001 From: yury Date: Tue, 31 Oct 2006 10:07:14 +0000 Subject: [PATCH] - protect export's held locks list by spin lock while adding there fixed up lock in mdt_intent_lock_replace(); - some cleanups. --- lustre/mdt/mdt_handler.c | 2 ++ lustre/mdt/mdt_reint.c | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index f230864..5682c55 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -2372,8 +2372,10 @@ int mdt_intent_lock_replace(struct mdt_thread_info *info, new_lock->l_writers = 0; new_lock->l_export = class_export_get(req->rq_export); + spin_lock(&req->rq_export->exp_ldlm_data.led_lock); list_add(&new_lock->l_export_chain, &new_lock->l_export->exp_ldlm_data.led_held_locks); + spin_unlock(&req->rq_export->exp_ldlm_data.led_lock); new_lock->l_blocking_ast = lock->l_blocking_ast; new_lock->l_completion_ast = lock->l_completion_ast; diff --git a/lustre/mdt/mdt_reint.c b/lustre/mdt/mdt_reint.c index 9a6c000..c355021 100644 --- a/lustre/mdt/mdt_reint.c +++ b/lustre/mdt/mdt_reint.c @@ -97,7 +97,7 @@ static int mdt_md_mkobj(struct mdt_thread_info *info) ENTRY; DEBUG_REQ(D_INODE, mdt_info_req(info), "partial create "DFID"\n", - PFID(info->mti_rr.rr_fid2)); + PFID(info->mti_rr.rr_fid2)); repbody = req_capsule_server_get(&info->mti_pill, &RMF_MDT_BODY); @@ -107,8 +107,11 @@ static int mdt_md_mkobj(struct mdt_thread_info *info) ma->ma_need = MA_INODE; ma->ma_valid = 0; - /* Cross-ref create can encounter already created obj in case - * of recovery, just get attr in that case */ + + /* + * Cross-ref create can encounter already created obj in case of + * recovery, just get attr in that case. + */ if (mdt_object_exists(o) == 1) { rc = mo_attr_get(info->mti_env, next, ma); } else { @@ -380,11 +383,11 @@ static int mdt_reint_unlink(struct mdt_thread_info *info, GOTO(out_unlock_parent, rc = -EINVAL); if (rr->rr_name[0] == 0) { - /* remote partial operation - * It is possible that replay can happen on parent MDS - * and this operation will be repeated. - * Therefore the object absense is allowed case - * and nothing should be done + /* + * Remote partial operation. It is possible that replay may + * happen on parent MDT and this operation will be repeated. + * Therefore the object absense is allowed case and nothing + * should be done here. */ if (mdt_object_exists(mp) > 0) { mdt_set_capainfo(info, 0, rr->rr_fid1, BYPASS_CAPA); -- 1.8.3.1