]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
vfs: fix symlinkat to retry on ESTALE errors
authorJeff Layton <jlayton@redhat.com>
Tue, 11 Dec 2012 17:10:08 +0000 (12:10 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 20 Dec 2012 23:50:03 +0000 (18:50 -0500)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index 1beebc1a38c93ccc95dcb1b94fc426fde110bc9f..b06a111591a85ffe6c0f044088370e24bd6569fd 100644 (file)
@@ -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;