aboutsummaryrefslogtreecommitdiffstats
path: root/fs/stat.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-12-11 12:10:05 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-12-20 18:50:01 -0500
commit836fb7e7b978e5f3b8b52e40838ddc50264723f0 (patch)
tree777bbb681013843c3cbad6b908bdc6c4aee3c09b /fs/stat.c
parentb9d6ba94b875192ef5e2dab92d72beea33b83c3d (diff)
vfs: make fstatat retry on ESTALE errors from getattr call
Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/stat.c')
-rw-r--r--fs/stat.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/stat.c b/fs/stat.c
index eae494630a36..d22199527880 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -74,7 +74,7 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,
74{ 74{
75 struct path path; 75 struct path path;
76 int error = -EINVAL; 76 int error = -EINVAL;
77 int lookup_flags = 0; 77 unsigned int lookup_flags = 0;
78 78
79 if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | 79 if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT |
80 AT_EMPTY_PATH)) != 0) 80 AT_EMPTY_PATH)) != 0)
@@ -84,13 +84,17 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,
84 lookup_flags |= LOOKUP_FOLLOW; 84 lookup_flags |= LOOKUP_FOLLOW;
85 if (flag & AT_EMPTY_PATH) 85 if (flag & AT_EMPTY_PATH)
86 lookup_flags |= LOOKUP_EMPTY; 86 lookup_flags |= LOOKUP_EMPTY;
87 87retry:
88 error = user_path_at(dfd, filename, lookup_flags, &path); 88 error = user_path_at(dfd, filename, lookup_flags, &path);
89 if (error) 89 if (error)
90 goto out; 90 goto out;
91 91
92 error = vfs_getattr(path.mnt, path.dentry, stat); 92 error = vfs_getattr(path.mnt, path.dentry, stat);
93 path_put(&path); 93 path_put(&path);
94 if (retry_estale(error, lookup_flags)) {
95 lookup_flags |= LOOKUP_REVAL;
96 goto retry;
97 }
94out: 98out:
95 return error; 99 return error;
96} 100}