diff options
-rw-r--r-- | fs/open.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -514,11 +514,16 @@ SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode | |||
514 | { | 514 | { |
515 | struct path path; | 515 | struct path path; |
516 | int error; | 516 | int error; |
517 | 517 | unsigned int lookup_flags = LOOKUP_FOLLOW; | |
518 | error = user_path_at(dfd, filename, LOOKUP_FOLLOW, &path); | 518 | retry: |
519 | error = user_path_at(dfd, filename, lookup_flags, &path); | ||
519 | if (!error) { | 520 | if (!error) { |
520 | error = chmod_common(&path, mode); | 521 | error = chmod_common(&path, mode); |
521 | path_put(&path); | 522 | path_put(&path); |
523 | if (retry_estale(error, lookup_flags)) { | ||
524 | lookup_flags |= LOOKUP_REVAL; | ||
525 | goto retry; | ||
526 | } | ||
522 | } | 527 | } |
523 | return error; | 528 | return error; |
524 | } | 529 | } |