NFS: Don't hash the negative dentry when optimising for an O_EXCL open

We don't want to leave an unverified hashed negative dentry if the
exclusive create fails to complete.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Trond Myklebust
2007-10-02 18:38:53 -04:00
parent 5724ab3787
commit d4d9cdcb47
2 changed files with 5 additions and 3 deletions

View File

@@ -992,9 +992,10 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
}
dentry->d_op = NFS_PROTO(dir)->dentry_ops;
/* Let vfs_create() deal with O_EXCL */
/* Let vfs_create() deal with O_EXCL. Instantiate, but don't hash
* the dentry. */
if (nd->intent.open.flags & O_EXCL) {
d_add(dentry, NULL);
d_instantiate(dentry, NULL);
goto out;
}