From 993362bd81e0e884772d00da8e535270df433c75 Mon Sep 17 00:00:00 2001 From: zhanghc Date: Wed, 14 Oct 2009 09:00:47 +0000 Subject: [PATCH] b=20584 set "IT_CREAT" in the default intent(oit) in function ll_file_open(llite/file.c) if "it_flags" contains O_CREAT i=johann@sun.com i=alexey.lyashkov@sun.com --- lustre/llite/file.c | 6 ++++++ lustre/mds/mds_reint.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/lustre/llite/file.c b/lustre/llite/file.c index e021fc4..c10bace 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -461,6 +461,12 @@ int ll_file_open(struct inode *inode, struct file *file) * already? XXX - NFS implications? */ oit.it_flags &= ~O_EXCL; + /* bug20584, if "it_flags" contains O_CREAT, the file will be + * created if necessary, then "IT_CREAT" should be set to keep + * consistent with it */ + if (oit.it_flags & O_CREAT) + oit.it_op |= IT_CREAT; + it = &oit; } diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index c3880f6..c99f525 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -1673,6 +1673,9 @@ retry_locks: if (rc) GOTO(cleanup, rc); + if (IS_DEADDIR((*dparentp)->d_inode)) + GOTO(cleanup, -ENOENT); + /* Step 4: Re-lookup child to verify it hasn't changed since locking */ rc = mds_verify_child(obd, &parent_res_id, parent_lockh, *dparentp, parent_mode, &child_res_id, child_lockh, dchildp, -- 1.8.3.1