aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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}