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>
This commit is contained in:
Родитель
0291c0a551
Коммит
2771261ec5
|
@ -445,8 +445,9 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename)
|
||||||
{
|
{
|
||||||
struct path path;
|
struct path path;
|
||||||
int error;
|
int error;
|
||||||
|
unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY;
|
||||||
error = user_path_dir(filename, &path);
|
retry:
|
||||||
|
error = user_path_at(AT_FDCWD, filename, lookup_flags, &path);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
@ -465,6 +466,10 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename)
|
||||||
error = 0;
|
error = 0;
|
||||||
dput_and_out:
|
dput_and_out:
|
||||||
path_put(&path);
|
path_put(&path);
|
||||||
|
if (retry_estale(error, lookup_flags)) {
|
||||||
|
lookup_flags |= LOOKUP_REVAL;
|
||||||
|
goto retry;
|
||||||
|
}
|
||||||
out:
|
out:
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче