]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
nfs_lookup: don't bother with d_instantiate(dentry, NULL)
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 8 Mar 2016 03:40:43 +0000 (22:40 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 14 Mar 2016 04:16:40 +0000 (00:16 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/nfs/dir.c

index 9cce67043f92a589193625ca3005d0b1e0f4e36b..4bfa7d8bcadee27ab9a6779b3d427170f98ac918 100644 (file)
@@ -1360,19 +1360,15 @@ struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned in
        dfprintk(VFS, "NFS: lookup(%pd2)\n", dentry);
        nfs_inc_stats(dir, NFSIOS_VFSLOOKUP);
 
-       res = ERR_PTR(-ENAMETOOLONG);
-       if (dentry->d_name.len > NFS_SERVER(dir)->namelen)
-               goto out;
+       if (unlikely(dentry->d_name.len > NFS_SERVER(dir)->namelen))
+               return ERR_PTR(-ENAMETOOLONG);
 
        /*
         * If we're doing an exclusive create, optimize away the lookup
         * but don't hash the dentry.
         */
-       if (nfs_is_exclusive_create(dir, flags)) {
-               d_instantiate(dentry, NULL);
-               res = NULL;
-               goto out;
-       }
+       if (nfs_is_exclusive_create(dir, flags))
+               return NULL;
 
        res = ERR_PTR(-ENOMEM);
        fhandle = nfs_alloc_fhandle();