vfs: fix user_statfs to retry once on ESTALE errors
authorJeff Layton <jlayton@redhat.com>
Tue, 11 Dec 2012 17:10:14 +0000 (12:10 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 20 Dec 2012 23:50:07 +0000 (18:50 -0500)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/statfs.c

index f8e832e6f0a2220d0e16163b230ad0f710ee4132..c219e733f55330741962173e994ac8d4e894a70f 100644 (file)
@@ -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;
 }