summaryrefslogtreecommitdiffstats
path: root/fs/statfs.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-12-11 18:10:14 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2012-12-21 00:50:07 +0100
commit96948fc6069b68380abac2944b8b02b43a2e2057 (patch)
tree7183ec09a0c317d2b6fbe71ca3e15dfab8e107cd /fs/statfs.c
parentvfs: make fchownat retry once on ESTALE errors (diff)
downloadlinux-96948fc6069b68380abac2944b8b02b43a2e2057.tar.xz
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 '')
-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;
}