summaryrefslogtreecommitdiffstats
path: root/fs/statfs.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-12-11 12:10:14 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-12-20 18:50:07 -0500
commit96948fc6069b68380abac2944b8b02b43a2e2057 (patch)
tree7183ec09a0c317d2b6fbe71ca3e15dfab8e107cd /fs/statfs.c
parent99a5df37a03c99e57d0da4f847a515b658963fbb (diff)
downloadlinux-96948fc6069b68380abac2944b8b02b43a2e2057.tar.gz
linux-96948fc6069b68380abac2944b8b02b43a2e2057.tar.bz2
linux-96948fc6069b68380abac2944b8b02b43a2e2057.zip
vfs: fix user_statfs to retry once on ESTALE errors
Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/statfs.c')
-rw-r--r--fs/statfs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/statfs.c b/fs/statfs.c
index f8e832e6f0a2..c219e733f553 100644
--- a/fs/statfs.c
+++ b/fs/statfs.c
@@ -77,10 +77,17 @@ EXPORT_SYMBOL(vfs_statfs);
int user_statfs(const char __user *pathname, struct kstatfs *st)
{
struct path path;
- int error = user_path_at(AT_FDCWD, pathname, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &path);
+ int error;
+ unsigned int lookup_flags = LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT;
+retry:
+ error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path);
if (!error) {
error = vfs_statfs(&path, st);
path_put(&path);
+ if (retry_estale(error, lookup_flags)) {
+ lookup_flags |= LOOKUP_REVAL;
+ goto retry;
+ }
}
return error;
}