Commit 87fa5595 authored by Jeff Layton's avatar Jeff Layton Committed by Al Viro

vfs: have faccessat retry once on an ESTALE error

Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 48f7530d
...@@ -316,6 +316,7 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) ...@@ -316,6 +316,7 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
struct path path; struct path path;
struct inode *inode; struct inode *inode;
int res; int res;
unsigned int lookup_flags = LOOKUP_FOLLOW;
if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
return -EINVAL; return -EINVAL;
...@@ -338,8 +339,8 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) ...@@ -338,8 +339,8 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
} }
old_cred = override_creds(override_cred); old_cred = override_creds(override_cred);
retry:
res = user_path_at(dfd, filename, LOOKUP_FOLLOW, &path); res = user_path_at(dfd, filename, lookup_flags, &path);
if (res) if (res)
goto out; goto out;
...@@ -374,6 +375,10 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) ...@@ -374,6 +375,10 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
out_path_release: out_path_release:
path_put(&path); path_put(&path);
if (retry_estale(res, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
goto retry;
}
out: out:
revert_creds(old_cred); revert_creds(old_cred);
put_cred(override_cred); put_cred(override_cred);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment