aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-12-11 12:10:08 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-12-20 18:50:03 -0500
commitf46d3567b223e41e1f2faeb82d3b74a6d84fc508 (patch)
tree5b73c9e1db587472fa0d514fbb8cb8d009429720 /fs
parentb76d8b82266077dc7098dd13f321a616099a1bd8 (diff)
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')
-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,
3521 struct filename *from; 3521 struct filename *from;
3522 struct dentry *dentry; 3522 struct dentry *dentry;
3523 struct path path; 3523 struct path path;
3524 unsigned int lookup_flags = 0;
3524 3525
3525 from = getname(oldname); 3526 from = getname(oldname);
3526 if (IS_ERR(from)) 3527 if (IS_ERR(from))
3527 return PTR_ERR(from); 3528 return PTR_ERR(from);
3528 3529retry:
3529 dentry = user_path_create(newdfd, newname, &path, 0); 3530 dentry = user_path_create(newdfd, newname, &path, lookup_flags);
3530 error = PTR_ERR(dentry); 3531 error = PTR_ERR(dentry);
3531 if (IS_ERR(dentry)) 3532 if (IS_ERR(dentry))
3532 goto out_putname; 3533 goto out_putname;
@@ -3535,6 +3536,10 @@ SYSCALL_DEFINE3(symlinkat, const char __user *, oldname,
3535 if (!error) 3536 if (!error)
3536 error = vfs_symlink(path.dentry->d_inode, dentry, from->name); 3537 error = vfs_symlink(path.dentry->d_inode, dentry, from->name);
3537 done_path_create(&path, dentry); 3538 done_path_create(&path, dentry);
3539 if (retry_estale(error, lookup_flags)) {
3540 lookup_flags |= LOOKUP_REVAL;
3541 goto retry;
3542 }
3538out_putname: 3543out_putname:
3539 putname(from); 3544 putname(from);
3540 return error; 3545 return error;