Skip to content

Commit

Permalink
vfs: have chroot retry once on ESTALE error
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Jeff Layton authored and Al Viro committed Dec 20, 2012
1 parent 0291c0a commit 2771261
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,9 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename)
{
struct path path;
int error;

error = user_path_dir(filename, &path);
unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY;
retry:
error = user_path_at(AT_FDCWD, filename, lookup_flags, &path);
if (error)
goto out;

Expand All @@ -465,6 +466,10 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename)
error = 0;
dput_and_out:
path_put(&path);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
goto retry;
}
out:
return error;
}
Expand Down

0 comments on commit 2771261

Please sign in to comment.