From: Trond Myklebust Date: Wed, 5 Jul 2006 17:05:13 +0000 (-0400) Subject: NFS: Optimise away an excessive GETATTR call when a file is symlinked X-Git-Tag: v2.6.18-rc1~4^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e0641a7ad98fca5646a6be17605bc80f6c4ebde;p=linux-2.6 NFS: Optimise away an excessive GETATTR call when a file is symlinked 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 --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 3ddda6f7ec..e7ffb4deb3 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -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);