NFS: Fix the ESTALE "revalidation" in _nfs_revalidate_inode()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 28 Sep 2007 23:11:33 +0000 (19:11 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 9 Oct 2007 21:19:08 +0000 (17:19 -0400)
For one thing, the test NFS_ATTRTIMEO() == 0 makes no sense: we're
testing whether or not the cache timeout length is zero, which is totally
unrelated to the issue of whether or not we trust the file staleness.

Secondly, we do not want to retry the GETATTR once a file has been declared
stale by the server: we rather want to discard that inode as soon as
possible, since there are broken servers still in use out there that reuse
filehandles on new files.

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

index e37faa3a7bacfb14383dd843b45cad3639db2c2f..185cfd09d7f7831ff273f9d313fe22dccd84852e 100644 (file)
@@ -607,16 +607,10 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
        status = nfs_wait_on_inode(inode);
        if (status < 0)
                goto out;
-       if (NFS_STALE(inode)) {
-               status = -ESTALE;
-               /* Do we trust the cached ESTALE? */
-               if (NFS_ATTRTIMEO(inode) != 0) {
-                       if (nfsi->cache_validity & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME)) {
-                               /* no */
-                       } else
-                               goto out;
-               }
-       }
+
+       status = -ESTALE;
+       if (NFS_STALE(inode))
+               goto out;
 
        status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), &fattr);
        if (status != 0) {
This page took 0.026618 seconds and 5 git commands to generate.