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

Commit 14ff690c authored by Jeff Layton's avatar Jeff Layton Committed by Al Viro
Browse files

vfs: make fchmodat retry once on ESTALE errors

parent 2771261e
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -514,11 +514,16 @@ SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode
{
	struct path path;
	int error;

	error = user_path_at(dfd, filename, LOOKUP_FOLLOW, &path);
	unsigned int lookup_flags = LOOKUP_FOLLOW;
retry:
	error = user_path_at(dfd, filename, lookup_flags, &path);
	if (!error) {
		error = chmod_common(&path, mode);
		path_put(&path);
		if (retry_estale(error, lookup_flags)) {
			lookup_flags |= LOOKUP_REVAL;
			goto retry;
		}
	}
	return error;
}