diff options
-rw-r--r-- | fs/nfs/dir.c | 5 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 3 |
2 files changed, 5 insertions, 3 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 | |||
992 | } | 992 | } |
993 | dentry->d_op = NFS_PROTO(dir)->dentry_ops; | 993 | dentry->d_op = NFS_PROTO(dir)->dentry_ops; |
994 | 994 | ||
995 | /* Let vfs_create() deal with O_EXCL */ | 995 | /* Let vfs_create() deal with O_EXCL. Instantiate, but don't hash |
996 | * the dentry. */ | ||
996 | if (nd->intent.open.flags & O_EXCL) { | 997 | if (nd->intent.open.flags & O_EXCL) { |
997 | d_add(dentry, NULL); | 998 | d_instantiate(dentry, NULL); |
998 | goto out; | 999 | goto out; |
999 | } | 1000 | } |
1000 | 1001 | ||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 796bc8ea7194..0748c700301d 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -1879,11 +1879,12 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, | |||
1879 | } | 1879 | } |
1880 | state = nfs4_do_open(dir, &path, flags, sattr, cred); | 1880 | state = nfs4_do_open(dir, &path, flags, sattr, cred); |
1881 | put_rpccred(cred); | 1881 | put_rpccred(cred); |
1882 | d_drop(dentry); | ||
1882 | if (IS_ERR(state)) { | 1883 | if (IS_ERR(state)) { |
1883 | status = PTR_ERR(state); | 1884 | status = PTR_ERR(state); |
1884 | goto out; | 1885 | goto out; |
1885 | } | 1886 | } |
1886 | d_instantiate(dentry, igrab(state->inode)); | 1887 | d_add(dentry, igrab(state->inode)); |
1887 | if (flags & O_EXCL) { | 1888 | if (flags & O_EXCL) { |
1888 | struct nfs_fattr fattr; | 1889 | struct nfs_fattr fattr; |
1889 | status = nfs4_do_setattr(state->inode, &fattr, sattr, state); | 1890 | status = nfs4_do_setattr(state->inode, &fattr, sattr, state); |