diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-09-28 19:11:33 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2007-10-09 17:19:08 -0400 |
commit | 7fdc49c4e49ba926348f71844cda7f5e12709738 (patch) | |
tree | acd0344bf0bdb7318be81d25d4a479044d6f5e22 | |
parent | 8850df999cd16aa141098e2e8be04a590276f3cc (diff) |
NFS: Fix the ESTALE "revalidation" in _nfs_revalidate_inode()
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>
-rw-r--r-- | fs/nfs/inode.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index e37faa3a7bac..185cfd09d7f7 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -607,16 +607,10 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
607 | status = nfs_wait_on_inode(inode); | 607 | status = nfs_wait_on_inode(inode); |
608 | if (status < 0) | 608 | if (status < 0) |
609 | goto out; | 609 | goto out; |
610 | if (NFS_STALE(inode)) { | 610 | |
611 | status = -ESTALE; | 611 | status = -ESTALE; |
612 | /* Do we trust the cached ESTALE? */ | 612 | if (NFS_STALE(inode)) |
613 | if (NFS_ATTRTIMEO(inode) != 0) { | 613 | goto out; |
614 | if (nfsi->cache_validity & (NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ATIME)) { | ||
615 | /* no */ | ||
616 | } else | ||
617 | goto out; | ||
618 | } | ||
619 | } | ||
620 | 614 | ||
621 | status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), &fattr); | 615 | status = NFS_PROTO(inode)->getattr(server, NFS_FH(inode), &fattr); |
622 | if (status != 0) { | 616 | if (status != 0) { |