Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d4d9cdcb470784df76304f75d0ce88f20f15fa6a
Commit:     d4d9cdcb470784df76304f75d0ce88f20f15fa6a
Parent:     5724ab37872042176916441930e78fd353be1e5e
Author:     Trond Myklebust <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 2 18:38:53 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 17:19:27 2007 -0400

    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 <[EMAIL PROTECTED]>
---
 fs/nfs/dir.c      |    5 +++--
 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 3f0def6..166a833 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;
        }
 
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 796bc8e..0748c70 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,
        }
        state = nfs4_do_open(dir, &path, flags, sattr, cred);
        put_rpccred(cred);
+       d_drop(dentry);
        if (IS_ERR(state)) {
                status = PTR_ERR(state);
                goto out;
        }
-       d_instantiate(dentry, igrab(state->inode));
+       d_add(dentry, igrab(state->inode));
        if (flags & O_EXCL) {
                struct nfs_fattr fattr;
                status = nfs4_do_setattr(state->inode, &fattr, sattr, state);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to