aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMenyhart Zoltan <Zoltan.Menyhart@bull.net>2010-09-12 19:55:26 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-09-12 19:55:26 -0400
commitfbf3fdd2443965d9ba6fb4b5fecd1f6e0847218f (patch)
tree55e1b68c3304b35e8c7e8d1f0de54521189908b9
parentb20d37ca9561711c6a3c4b859c2855f49565e061 (diff)
statfs() gives ESTALE error
Hi, An NFS client executes a statfs("file", &buff) call. "file" exists / existed, the client has read / written it, but it has already closed it. user_path(pathname, &path) looks up "file" successfully in the directory-cache and restarts the aging timer of the directory-entry. Even if "file" has already been removed from the server, because the lookupcache=positive option I use, keeps the entries valid for a while. nfs_statfs() returns ESTALE if "file" has already been removed from the server. If the user application repeats the statfs("file", &buff) call, we are stuck: "file" remains young forever in the directory-cache. Signed-off-by: Zoltan Menyhart <Zoltan.Menyhart@bull.net> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@kernel.org
-rw-r--r--fs/nfs/super.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index ec3966e4706b..f4cbf0c306c6 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -431,7 +431,15 @@ static int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
431 goto out_err; 431 goto out_err;
432 432
433 error = server->nfs_client->rpc_ops->statfs(server, fh, &res); 433 error = server->nfs_client->rpc_ops->statfs(server, fh, &res);
434 if (unlikely(error == -ESTALE)) {
435 struct dentry *pd_dentry;
434 436
437 pd_dentry = dget_parent(dentry);
438 if (pd_dentry != NULL) {
439 nfs_zap_caches(pd_dentry->d_inode);
440 dput(pd_dentry);
441 }
442 }
435 nfs_free_fattr(res.fattr); 443 nfs_free_fattr(res.fattr);
436 if (error < 0) 444 if (error < 0)
437 goto out_err; 445 goto out_err;