diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-12-11 12:10:06 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-20 18:50:01 -0500 |
commit | 7955119e02d9fdf78a39fba8073f19ca6152613e (patch) | |
tree | 163bfbf2174ca89d541f63b0114b16665e02e6e5 | |
parent | 836fb7e7b978e5f3b8b52e40838ddc50264723f0 (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>
-rw-r--r-- | fs/stat.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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); | 308 | retry: |
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 | } |