From: tappro Date: Wed, 11 Oct 2006 13:22:37 +0000 (+0000) Subject: - fix the checking stale objects in mdt_getattr_name_lock X-Git-Tag: v1_8_0_110~486^2~598 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=bb0991c028c28d3a8bdbbada92d9bd4457b72b9f;p=fs%2Flustre-release.git - fix the checking stale objects in mdt_getattr_name_lock --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index e3d7c8c..fcc0ef4 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -566,6 +566,16 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info, PFID(mdt_object_fid(parent)), name, ldlm_rep); mdt_set_disposition(info, ldlm_rep, DISP_LOOKUP_EXECD); + + rc = mdt_object_exists(parent); + if (rc == 0) + RETURN(-ESTALE); + else if (rc < 0) { + CERROR("Object "DFID" locates on remote server\n", + PFID(mdt_object_fid(parent))); + LBUG(); + } + if (strlen(name) == 0) { /* Only getattr on the child. Parent is on another node. */ mdt_set_disposition(info, ldlm_rep, DISP_LOOKUP_POS); @@ -608,15 +618,6 @@ static int mdt_getattr_name_lock(struct mdt_thread_info *info, GOTO(out, rc); } - rc = mdt_object_exists(parent); - if (rc == 0) - RETURN(-ESTALE); - else if (rc < 0) { - CERROR("Object "DFID" locates on remote server\n", - PFID(mdt_object_fid(parent))); - LBUG(); - } - /*step 1: lock parent */ lhp = &info->mti_lh[MDT_LH_PARENT]; lhp->mlh_mode = LCK_CR;