aboutsummaryrefslogtreecommitdiffstats
path: root/fs/stat.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-12-11 12:10:06 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-12-20 18:50:01 -0500
commit7955119e02d9fdf78a39fba8073f19ca6152613e (patch)
tree163bfbf2174ca89d541f63b0114b16665e02e6e5 /fs/stat.c
parent836fb7e7b978e5f3b8b52e40838ddc50264723f0 (diff)
vfs: fix readlinkat to retry on ESTALE
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, 7 insertions, 1 deletions
diff --git a/fs/stat.c b/fs/stat.c
index d22199527880..14f45459c83d 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -300,11 +300,13 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
300 struct path path; 300 struct path path;
301 int error; 301 int error;
302 int empty = 0; 302 int empty = 0;
303 unsigned int lookup_flags = LOOKUP_EMPTY;
303 304
304 if (bufsiz <= 0) 305 if (bufsiz <= 0)
305 return -EINVAL; 306 return -EINVAL;
306 307
307 error = user_path_at_empty(dfd, pathname, LOOKUP_EMPTY, &path, &empty); 308retry:
309 error = user_path_at_empty(dfd, pathname, lookup_flags, &path, &empty);
308 if (!error) { 310 if (!error) {
309 struct inode *inode = path.dentry->d_inode; 311 struct inode *inode = path.dentry->d_inode;
310 312
@@ -318,6 +320,10 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
318 } 320 }
319 } 321 }
320 path_put(&path); 322 path_put(&path);
323 if (retry_estale(error, lookup_flags)) {
324 lookup_flags |= LOOKUP_REVAL;
325 goto retry;
326 }
321 } 327 }
322 return error; 328 return error;
323} 329}