diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-12-20 17:08:32 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-20 18:50:06 -0500 |
commit | 2771261ec5b677a38f0cd5fcfc6cefd5393787ef (patch) | |
tree | 1977d9300293a73fa653695fbe37e6acd015cb78 /fs | |
parent | 0291c0a551d5b0856627f2cb294da05f122414a0 (diff) |
vfs: have chroot retry 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
@@ -445,8 +445,9 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename) | |||
445 | { | 445 | { |
446 | struct path path; | 446 | struct path path; |
447 | int error; | 447 | int error; |
448 | 448 | unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY; | |
449 | error = user_path_dir(filename, &path); | 449 | retry: |
450 | error = user_path_at(AT_FDCWD, filename, lookup_flags, &path); | ||
450 | if (error) | 451 | if (error) |
451 | goto out; | 452 | goto out; |
452 | 453 | ||
@@ -465,6 +466,10 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename) | |||
465 | error = 0; | 466 | error = 0; |
466 | dput_and_out: | 467 | dput_and_out: |
467 | path_put(&path); | 468 | path_put(&path); |
469 | if (retry_estale(error, lookup_flags)) { | ||
470 | lookup_flags |= LOOKUP_REVAL; | ||
471 | goto retry; | ||
472 | } | ||
468 | out: | 473 | out: |
469 | return error; | 474 | return error; |
470 | } | 475 | } |