diff options
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -316,6 +316,7 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) | |||
316 | struct path path; | 316 | struct path path; |
317 | struct inode *inode; | 317 | struct inode *inode; |
318 | int res; | 318 | int res; |
319 | unsigned int lookup_flags = LOOKUP_FOLLOW; | ||
319 | 320 | ||
320 | if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ | 321 | if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */ |
321 | return -EINVAL; | 322 | return -EINVAL; |
@@ -338,8 +339,8 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) | |||
338 | } | 339 | } |
339 | 340 | ||
340 | old_cred = override_creds(override_cred); | 341 | old_cred = override_creds(override_cred); |
341 | 342 | retry: | |
342 | res = user_path_at(dfd, filename, LOOKUP_FOLLOW, &path); | 343 | res = user_path_at(dfd, filename, lookup_flags, &path); |
343 | if (res) | 344 | if (res) |
344 | goto out; | 345 | goto out; |
345 | 346 | ||
@@ -374,6 +375,10 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode) | |||
374 | 375 | ||
375 | out_path_release: | 376 | out_path_release: |
376 | path_put(&path); | 377 | path_put(&path); |
378 | if (retry_estale(res, lookup_flags)) { | ||
379 | lookup_flags |= LOOKUP_REVAL; | ||
380 | goto retry; | ||
381 | } | ||
377 | out: | 382 | out: |
378 | revert_creds(old_cred); | 383 | revert_creds(old_cred); |
379 | put_cred(override_cred); | 384 | put_cred(override_cred); |