From bcbda8ba0eb4ae019639795f59e5801ca8509c14 Mon Sep 17 00:00:00 2001 From: fanyong Date: Tue, 21 Nov 2006 07:40:33 +0000 Subject: [PATCH] (1) For remote create, only continue when lookup return ENOENT (2) For mdd_lookup, do NOT return ENOENT when parent is dead obj. ENOENT means child does not exist. --- lustre/cmm/cmm_object.c | 2 ++ lustre/mdd/mdd_dir.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/cmm/cmm_object.c b/lustre/cmm/cmm_object.c index fb489ba..1877680 100644 --- a/lustre/cmm/cmm_object.c +++ b/lustre/cmm/cmm_object.c @@ -849,6 +849,8 @@ static int cmr_create(const struct lu_env *env, struct md_object *mo_p, &cmm_env_info(env)->cmi_fid, NULL); if (rc == 0) RETURN(-EEXIST); + else if (rc != -ENOENT) + RETURN(rc); /* check the SGID attr */ cmi = cmm_env_info(env); diff --git a/lustre/mdd/mdd_dir.c b/lustre/mdd/mdd_dir.c index 5f8662d..92d115f 100644 --- a/lustre/mdd/mdd_dir.c +++ b/lustre/mdd/mdd_dir.c @@ -924,7 +924,7 @@ __mdd_lookup(const struct lu_env *env, struct md_object *pobj, mdd_lprocfs_time_start(mdo2mdd(pobj), &start, LPROC_MDD_LOOKUP); if (mdd_is_dead_obj(mdd_obj)) - RETURN(-ENOENT); + RETURN(-ESTALE); rc = lu_object_exists(mdd2lu_obj(mdd_obj)); if (rc == 0) -- 1.8.3.1