Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7955119e authored by Jeff Layton's avatar Jeff Layton Committed by Al Viro
Browse files

vfs: fix readlinkat to retry on ESTALE

parent 836fb7e7
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -300,11 +300,13 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
	struct path path;
	struct path path;
	int error;
	int error;
	int empty = 0;
	int empty = 0;
	unsigned int lookup_flags = LOOKUP_EMPTY;


	if (bufsiz <= 0)
	if (bufsiz <= 0)
		return -EINVAL;
		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) {
	if (!error) {
		struct inode *inode = path.dentry->d_inode;
		struct inode *inode = path.dentry->d_inode;


@@ -318,6 +320,10 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
			}
			}
		}
		}
		path_put(&path);
		path_put(&path);
		if (retry_estale(error, lookup_flags)) {
			lookup_flags |= LOOKUP_REVAL;
			goto retry;
		}
	}
	}
	return error;
	return error;
}
}