From: Jeff Layton Date: Tue, 11 Dec 2012 17:10:13 +0000 (-0500) Subject: vfs: make fchownat retry once on ESTALE errors X-Git-Tag: firefly_0821_release~3680^2~1354^2~10 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=99a5df37a03c99e57d0da4f847a515b658963fbb;p=firefly-linux-kernel-4.4.55.git vfs: make fchownat retry once on ESTALE errors Signed-off-by: Jeff Layton Signed-off-by: Al Viro --- diff --git a/fs/open.c b/fs/open.c index 99c3ce5f897b..9b33c0cbfacf 100644 --- a/fs/open.c +++ b/fs/open.c @@ -582,6 +582,7 @@ SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user, lookup_flags = (flag & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW; if (flag & AT_EMPTY_PATH) lookup_flags |= LOOKUP_EMPTY; +retry: error = user_path_at(dfd, filename, lookup_flags, &path); if (error) goto out; @@ -592,6 +593,10 @@ SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user, mnt_drop_write(path.mnt); out_release: path_put(&path); + if (retry_estale(error, lookup_flags)) { + lookup_flags |= LOOKUP_REVAL; + goto retry; + } out: return error; }