From bec6b31c53b43052247bc954bcad3a2cd0a30fdd Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Tue, 11 Dec 2012 12:10:08 -0500 Subject: [PATCH] --- yaml --- r: 347845 b: refs/heads/master c: f46d3567b223e41e1f2faeb82d3b74a6d84fc508 h: refs/heads/master i: 347843: 4a1374a72459d8c8c49e3755fb7cb32d8729799d v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index aa9f08a673e4..807badab1bff 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b76d8b82266077dc7098dd13f321a616099a1bd8 +refs/heads/master: f46d3567b223e41e1f2faeb82d3b74a6d84fc508 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 1beebc1a38c9..b06a111591a8 100644 --- a/trunk/fs/namei.c +++ b/trunk/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;