Commit 96948fc6 authored by Jeff Layton's avatar Jeff Layton Committed by Al Viro

vfs: fix user_statfs to retry once on ESTALE errors

Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 99a5df37
...@@ -77,10 +77,17 @@ EXPORT_SYMBOL(vfs_statfs); ...@@ -77,10 +77,17 @@ EXPORT_SYMBOL(vfs_statfs);
int user_statfs(const char __user *pathname, struct kstatfs *st) int user_statfs(const char __user *pathname, struct kstatfs *st)
{ {
struct path path; 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) { if (!error) {
error = vfs_statfs(&path, st); error = vfs_statfs(&path, st);
path_put(&path); path_put(&path);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
goto retry;
}
} }
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment