From 01b1ee268fc9e41c057737fa77bdc01298779b9c Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 12 Aug 2003 16:18:37 +0000 Subject: [PATCH] Exit early from mds_open() if we get an error. b=1749 r=phil --- lustre/mds/handler.c | 2 ++ lustre/mds/mds_open.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index fd46c4f..cbcfdae 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -1806,6 +1806,8 @@ static int ldlm_intent_policy(struct ldlm_namespace *ns, rep->lock_policy_res2 = mds_reint(req, offset, &lockh); /* We abort the lock if the lookup was negative and * we did not make it to the OPEN portion */ + if (!intent_disposition(rep, DISP_LOOKUP_EXECD)) + RETURN(ELDLM_LOCK_ABORTED); if (intent_disposition(rep, DISP_LOOKUP_NEG) && !intent_disposition(rep, DISP_OPEN_OPEN)) RETURN(ELDLM_LOCK_ABORTED); diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 2bd2f8c..c97c53e 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -405,7 +405,6 @@ int mds_open(struct mds_update_record *rec, int offset, acc_mode |= MAY_WRITE; /* Step 1: Find and lock the parent */ - intent_set_disposition(rep, DISP_LOOKUP_EXECD); parent_mode = (rec->ur_flags & O_CREAT) ? LCK_PW : LCK_PR; parent = mds_fid2locked_dentry(obd, rec->ur_fid1, NULL, parent_mode, &parent_lockh); @@ -425,6 +424,7 @@ int mds_open(struct mds_update_record *rec, int offset, cleanup_phase = 2; /* child dentry */ + intent_set_disposition(rep, DISP_LOOKUP_EXECD); if (dchild->d_inode) intent_set_disposition(rep, DISP_LOOKUP_POS); else -- 1.8.3.1