summaryrefslogtreecommitdiff
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-02 18:38:53 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:19:27 -0400
commitd4d9cdcb470784df76304f75d0ce88f20f15fa6a (patch)
tree7066e4640947f078855b47501e69f76ff775a834 /fs/nfs/dir.c
parent5724ab37872042176916441930e78fd353be1e5e (diff)
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>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 3f0def65b8ab..166a833be661 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -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;
}