diff options
Diffstat (limited to 'fs/statfs.c')
| -rw-r--r-- | fs/statfs.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/fs/statfs.c b/fs/statfs.c index 2aa6a22e0be..083dc0ac914 100644 --- a/fs/statfs.c +++ b/fs/statfs.c @@ -1,5 +1,5 @@ #include <linux/syscalls.h> -#include <linux/module.h> +#include <linux/export.h> #include <linux/fs.h> #include <linux/file.h> #include <linux/mount.h> @@ -77,21 +77,28 @@ 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; } int fd_statfs(int fd, struct kstatfs *st) { - struct file *file = fget(fd); + struct fd f = fdget_raw(fd); int error = -EBADF; - if (file) { - error = vfs_statfs(&file->f_path, st); - fput(file); + if (f.file) { + error = vfs_statfs(&f.file->f_path, st); + fdput(f); } return error; } |
