summary refs log tree commit diff
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-12-11 12:10:06 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-12-20 18:50:01 -0500
commit7955119e02d9fdf78a39fba8073f19ca6152613e (patch)
tree163bfbf2174ca89d541f63b0114b16665e02e6e5 /fs
parent836fb7e7b978e5f3b8b52e40838ddc50264723f0 (diff)
downloadlinux-7955119e02d9fdf78a39fba8073f19ca6152613e.tar.gz
vfs: fix readlinkat to retry on ESTALE
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/stat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/stat.c b/fs/stat.c
index d22199527880..14f45459c83d 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -300,11 +300,13 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
 	struct path path;
 	int error;
 	int empty = 0;
+	unsigned int lookup_flags = LOOKUP_EMPTY;
 
 	if (bufsiz <= 0)
 		return -EINVAL;
 
-	error = user_path_at_empty(dfd, pathname, LOOKUP_EMPTY, &path, &empty);
+retry:
+	error = user_path_at_empty(dfd, pathname, lookup_flags, &path, &empty);
 	if (!error) {
 		struct inode *inode = path.dentry->d_inode;
 
@@ -318,6 +320,10 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
 			}
 		}
 		path_put(&path);
+		if (retry_estale(error, lookup_flags)) {
+			lookup_flags |= LOOKUP_REVAL;
+			goto retry;
+		}
 	}
 	return error;
 }