From: Jeff Layton Date: Tue, 11 Dec 2012 17:10:12 +0000 (-0500) Subject: vfs: have chdir retry lookup and call once on ESTALE error X-Git-Tag: firefly_0821_release~3680^2~1354^2~13 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0291c0a551d5b0856627f2cb294da05f122414a0;p=firefly-linux-kernel-4.4.55.git vfs: have chdir retry lookup and call once on ESTALE error Signed-off-by: Jeff Layton Signed-off-by: Al Viro --- diff --git a/fs/open.c b/fs/open.c index a994ccf39b40..402dfcb6720b 100644 --- a/fs/open.c +++ b/fs/open.c @@ -394,8 +394,9 @@ SYSCALL_DEFINE1(chdir, const char __user *, filename) { struct path path; int error; - - error = user_path_dir(filename, &path); + unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY; +retry: + error = user_path_at(AT_FDCWD, filename, lookup_flags, &path); if (error) goto out; @@ -407,6 +408,10 @@ SYSCALL_DEFINE1(chdir, const char __user *, filename) dput_and_out: path_put(&path); + if (retry_estale(error, lookup_flags)) { + lookup_flags |= LOOKUP_REVAL; + goto retry; + } out: return error; }