From: braam Date: Wed, 29 Jan 2003 19:51:34 +0000 (+0000) Subject: - fix for O_EXCL case in mds_open X-Git-Tag: v1_7_100~1^94~134 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f22599462458008722b650a05a9d8cf54044c059;p=fs%2Flustre-release.git - fix for O_EXCL case in mds_open - updates to cray plan - remove unnecessary error handling from mdc_completion_callback --- 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.