diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-12-11 12:10:12 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-20 18:50:06 -0500 |
commit | 0291c0a551d5b0856627f2cb294da05f122414a0 (patch) | |
tree | 1dce5d588af3ddc3d8c61fdc3a02e921830b75e7 /fs | |
parent | 87fa55952b7347175c6e2f03874869ad2c055adb (diff) |
vfs: have chdir retry lookup and call once on ESTALE error
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/open.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -394,8 +394,9 @@ SYSCALL_DEFINE1(chdir, const char __user *, filename) | |||
394 | { | 394 | { |
395 | struct path path; | 395 | struct path path; |
396 | int error; | 396 | int error; |
397 | 397 | unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY; | |
398 | error = user_path_dir(filename, &path); | 398 | retry: |
399 | error = user_path_at(AT_FDCWD, filename, lookup_flags, &path); | ||
399 | if (error) | 400 | if (error) |
400 | goto out; | 401 | goto out; |
401 | 402 | ||
@@ -407,6 +408,10 @@ SYSCALL_DEFINE1(chdir, const char __user *, filename) | |||
407 | 408 | ||
408 | dput_and_out: | 409 | dput_and_out: |
409 | path_put(&path); | 410 | path_put(&path); |
411 | if (retry_estale(error, lookup_flags)) { | ||
412 | lookup_flags |= LOOKUP_REVAL; | ||
413 | goto retry; | ||
414 | } | ||
410 | out: | 415 | out: |
411 | return error; | 416 | return error; |
412 | } | 417 | } |