From f22599462458008722b650a05a9d8cf54044c059 Mon Sep 17 00:00:00 2001 From: braam Date: Wed, 29 Jan 2003 19:51:34 +0000 Subject: [PATCH] - fix for O_EXCL case in mds_open - updates to cray plan - remove unnecessary error handling from mdc_completion_callback --- lustre/mds/mds_open.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index 5f0bc36..d072a6e 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -124,7 +124,11 @@ int mds_open(struct mds_update_record *rec, int offset, rep->lock_policy_res1 |= IT_OPEN_NEG; /* Negative dentry, just create the file */ - if ((rec->ur_flags & O_CREAT) && !dchild->d_inode) { + if (dchild->d_inode) { + up(&dir->i_sem); + if ((rec->ur_flags & (O_CREATE|O_EXCL)) == (O_CREATE|O_EXCL)) + GOTO(out_ldput, rc = -EEXIST); + } else if ((rec->ur_flags & O_CREAT) && !dchild->d_inode) { int err; void *handle; mds_start_transno(mds); @@ -150,9 +154,7 @@ int mds_open(struct mds_update_record *rec, int offset, } else if (!dchild->d_inode) { up(&dir->i_sem); GOTO(out_ldput, rc = -ENOENT); - } else { - up(&dir->i_sem); - } + } /* * It already exists. -- 1.8.3.1