From: Jeff Layton Date: Thu, 20 Dec 2012 22:08:32 +0000 (-0500) Subject: vfs: have chroot retry once on ESTALE error X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=2771261ec5b677a38f0cd5fcfc6cefd5393787ef;p=openwrt%2Fstaging%2Fblogic.git vfs: have chroot retry 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 402dfcb6720b..a13a54d3e691 100644 --- a/fs/open.c +++ b/fs/open.c @@ -445,8 +445,9 @@ SYSCALL_DEFINE1(chroot, 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; @@ -465,6 +466,10 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename) error = 0; dput_and_out: path_put(&path); + if (retry_estale(error, lookup_flags)) { + lookup_flags |= LOOKUP_REVAL; + goto retry; + } out: return error; }