summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorJeff Layton2012-12-11 18:10:08 +0100
committerAl Viro2012-12-21 00:50:03 +0100
commitf46d3567b223e41e1f2faeb82d3b74a6d84fc508 (patch)
tree5b73c9e1db587472fa0d514fbb8cb8d009429720 /fs/namei.c
parentvfs: fix mkdirat to retry once on an ESTALE error (diff)
downloadkernel-qcow2-linux-f46d3567b223e41e1f2faeb82d3b74a6d84fc508.tar.gz
kernel-qcow2-linux-f46d3567b223e41e1f2faeb82d3b74a6d84fc508.tar.xz
kernel-qcow2-linux-f46d3567b223e41e1f2faeb82d3b74a6d84fc508.zip
vfs: fix symlinkat to retry on ESTALE errors
Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 1beebc1a38c9..b06a111591a8 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3521,12 +3521,13 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
struct filename *from;
struct dentry *dentry;
struct path path;
+ unsigned int lookup_flags = 0;
from = getname(oldname);
if (IS_ERR(from))
return PTR_ERR(from);
-
- dentry = user_path_create(newdfd, newname, &path, 0);
+retry:
+ dentry = user_path_create(newdfd, newname, &path, lookup_flags);
error = PTR_ERR(dentry);
if (IS_ERR(dentry))
goto out_putname;
@@ -3535,6 +3536,10 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
if (!error)
error = vfs_symlink(path.dentry->d_inode, dentry, from->name);
done_path_create(&path, dentry);
+ if (retry_estale(error, lookup_flags)) {
+ lookup_flags |= LOOKUP_REVAL;
+ goto retry;
+ }
out_putname:
putname(from);
return error;