]> err.no Git - linux-2.6/commitdiff
NFS: Ensure that nfs_link() returns a hashed dentry
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 3 Oct 2007 01:58:05 +0000 (21:58 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 9 Oct 2007 21:20:18 +0000 (17:20 -0400)
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/dir.c

index c2207e3f26344f3b4ef86da47116263d0d65aaf7..d352509d7e2d7bdb23323e05795244a2994a232b 100644 (file)
@@ -1506,10 +1506,11 @@ nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
                dentry->d_parent->d_name.name, dentry->d_name.name);
 
        lock_kernel();
+       d_drop(dentry);
        error = NFS_PROTO(dir)->link(inode, dir, &dentry->d_name);
        if (error == 0) {
                atomic_inc(&inode->i_count);
-               d_instantiate(dentry, inode);
+               d_add(dentry, inode);
        }
        unlock_kernel();
        return error;