diff -urNp ref/fs/nfs/dir.c 2.4.20pre5aa1/fs/nfs/dir.c --- ref/fs/nfs/dir.c Fri Aug 30 05:43:14 2002 +++ 2.4.20pre5aa1/fs/nfs/dir.c Fri Aug 30 05:45:15 2002 @@ -456,16 +456,9 @@ static inline void nfs_renew_times(struc } static inline -int nfs_lookup_verify_inode(struct inode *inode, int flags) +int nfs_lookup_verify_inode(struct inode *inode) { - struct nfs_server *server = NFS_SERVER(inode); - /* - * If we're interested in close-to-open cache consistency, - * then we revalidate the inode upon lookup. - */ - if (!(server->flags & NFS_MOUNT_NOCTO) && !(flags & (LOOKUP_CONTINUE|LOOKUP_PARENT))) - NFS_CACHEINV(inode); - return nfs_revalidate_inode(server, inode); + return nfs_revalidate_inode(NFS_SERVER(inode), inode); } /* @@ -519,7 +512,7 @@ static int nfs_lookup_revalidate(struct /* Force a full look up iff the parent directory has changed */ if (nfs_check_verifier(dir, dentry)) { - if (nfs_lookup_verify_inode(inode, flags)) + if (nfs_lookup_verify_inode(inode)) goto out_bad; goto out_valid; } diff -urNp ref/fs/nfs/inode.c 2.4.20pre5aa1/fs/nfs/inode.c --- ref/fs/nfs/inode.c Fri Aug 30 05:42:24 2002 +++ 2.4.20pre5aa1/fs/nfs/inode.c Fri Aug 30 05:44:16 2002 @@ -860,15 +860,23 @@ int nfs_open(struct inode *inode, struct { struct rpc_auth *auth; struct rpc_cred *cred; + int err = 0; lock_kernel(); + /* Ensure that we revalidate the data cache */ + if (NFS_SERVER(inode)->flags & NFS_MOUNT_NOCTO) { + err = __nfs_revalidate_inode(NFS_SERVER(inode),inode); + if (err) + goto out; + } auth = NFS_CLIENT(inode)->cl_auth; cred = rpcauth_lookupcred(auth, 0); filp->private_data = cred; if (filp->f_mode & FMODE_WRITE) nfs_set_mmcred(inode, cred); +out: unlock_kernel(); - return 0; + return err; } int nfs_release(struct inode *inode, struct file *filp)