diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-12-11 18:10:05 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-21 00:50:01 +0100 |
commit | 836fb7e7b978e5f3b8b52e40838ddc50264723f0 (patch) | |
tree | 777bbb681013843c3cbad6b908bdc6c4aee3c09b /fs/stat.c | |
parent | vfs: add a retry_estale helper function to handle retries on ESTALE (diff) | |
download | linux-836fb7e7b978e5f3b8b52e40838ddc50264723f0.tar.xz linux-836fb7e7b978e5f3b8b52e40838ddc50264723f0.zip |
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.c | 8 |
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, { struct path path; int error = -EINVAL; - int lookup_flags = 0; + unsigned int lookup_flags = 0; if ((flag & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT | AT_EMPTY_PATH)) != 0) @@ -84,13 +84,17 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat, lookup_flags |= LOOKUP_FOLLOW; if (flag & AT_EMPTY_PATH) lookup_flags |= LOOKUP_EMPTY; - +retry: error = user_path_at(dfd, filename, lookup_flags, &path); if (error) goto out; error = vfs_getattr(path.mnt, path.dentry, stat); path_put(&path); + if (retry_estale(error, lookup_flags)) { + lookup_flags |= LOOKUP_REVAL; + goto retry; + } out: return error; } |