]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
NFS: Optimise away an excessive GETATTR call when a file is symlinked
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 5 Jul 2006 17:05:13 +0000 (13:05 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 5 Jul 2006 17:17:13 +0000 (13:17 -0400)
In the case when compiling via a symlink tree, we want to ensure that the
close-to-open GETATTR call is applied only to the final file, and not to
the symlink.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/dir.c

index 3ddda6f7ecc2dfad9c9c2b000b9a406349a7f65d..e7ffb4deb3e5f21973a0e165f229ddc98c7ff754 100644 (file)
@@ -690,7 +690,9 @@ int nfs_lookup_verify_inode(struct inode *inode, struct nameidata *nd)
                        goto out_force;
                /* This is an open(2) */
                if (nfs_lookup_check_intent(nd, LOOKUP_OPEN) != 0 &&
-                               !(server->flags & NFS_MOUNT_NOCTO))
+                               !(server->flags & NFS_MOUNT_NOCTO) &&
+                               (S_ISREG(inode->i_mode) ||
+                                S_ISDIR(inode->i_mode)))
                        goto out_force;
        }
        return nfs_revalidate_inode(server, inode);