From: tappro Date: Mon, 8 Aug 2005 23:03:16 +0000 (+0000) Subject: b=7277 X-Git-Tag: 1.4.10~777 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=e8379acd184725d2b31f7e5914a56043707318f1;p=fs%2Flustre-release.git b=7277 dentry is used before initialization. --- diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index d6e771a..114a174 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -3269,11 +3269,6 @@ static int mds_reint_rename_create_name(struct mds_update_record *rec, CDEBUG(D_OTHER, "%s: request to create name %s for "DLID4"\n", obd->obd_name, rec->ur_tgt, OLID4(rec->ur_id1)); - /* get parent id: ldlm lock on the parent protects ea */ - rc = mds_read_inode_sid(obd, de_tgtdir->d_inode, &ids[1]); - if (rc) - GOTO(cleanup, rc); - /* first, lookup the target */ rc = mds_get_parent_child_locked(obd, mds, rec->ur_id2, parent_lockh, &de_tgtdir, LCK_PW, MDS_INODELOCK_UPDATE, @@ -3283,6 +3278,11 @@ static int mds_reint_rename_create_name(struct mds_update_record *rec, if (rc) GOTO(cleanup, rc); + /* get parent id: ldlm lock on the parent protects ea */ + rc = mds_read_inode_sid(obd, de_tgtdir->d_inode, &ids[1]); + + if (rc) + GOTO(cleanup, rc); cleanup_phase = 1; LASSERT(de_tgtdir);