Commit f46d3567 authored by Jeff Layton's avatar Jeff Layton Committed by Al Viro

vfs: fix symlinkat to retry on ESTALE errors

Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent b76d8b82
...@@ -3521,12 +3521,13 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname, ...@@ -3521,12 +3521,13 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
struct filename *from; struct filename *from;
struct dentry *dentry; struct dentry *dentry;
struct path path; struct path path;
unsigned int lookup_flags = 0;
from = getname(oldname); from = getname(oldname);
if (IS_ERR(from)) if (IS_ERR(from))
return PTR_ERR(from); return PTR_ERR(from);
retry:
dentry = user_path_create(newdfd, newname, &path, 0); dentry = user_path_create(newdfd, newname, &path, lookup_flags);
error = PTR_ERR(dentry); error = PTR_ERR(dentry);
if (IS_ERR(dentry)) if (IS_ERR(dentry))
goto out_putname; goto out_putname;
...@@ -3535,6 +3536,10 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname, ...@@ -3535,6 +3536,10 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
if (!error) if (!error)
error = vfs_symlink(path.dentry->d_inode, dentry, from->name); error = vfs_symlink(path.dentry->d_inode, dentry, from->name);
done_path_create(&path, dentry); done_path_create(&path, dentry);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
goto retry;
}
out_putname: out_putname:
putname(from); putname(from);
return error; return error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment