diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-12-11 12:10:14 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-20 18:50:07 -0500 |
commit | 96948fc6069b68380abac2944b8b02b43a2e2057 (patch) | |
tree | 7183ec09a0c317d2b6fbe71ca3e15dfab8e107cd /fs/statfs.c | |
parent | 99a5df37a03c99e57d0da4f847a515b658963fbb (diff) |
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.c | 9 |
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); | |||
77 | int user_statfs(const char __user *pathname, struct kstatfs *st) | 77 | int user_statfs(const char __user *pathname, struct kstatfs *st) |
78 | { | 78 | { |
79 | struct path path; | 79 | struct path path; |
80 | int error = user_path_at(AT_FDCWD, pathname, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &path); | 80 | int error; |
81 | unsigned int lookup_flags = LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT; | ||
82 | retry: | ||
83 | error = user_path_at(AT_FDCWD, pathname, lookup_flags, &path); | ||
81 | if (!error) { | 84 | if (!error) { |
82 | error = vfs_statfs(&path, st); | 85 | error = vfs_statfs(&path, st); |
83 | path_put(&path); | 86 | path_put(&path); |
87 | if (retry_estale(error, lookup_flags)) { | ||
88 | lookup_flags |= LOOKUP_REVAL; | ||
89 | goto retry; | ||
90 | } | ||
84 | } | 91 | } |
85 | return error; | 92 | return error; |
86 | } | 93 | } |