From 7e8283273a121145dfb4179b9745274f1487622d Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Thu, 20 Dec 2012 16:15:38 -0500 Subject: [PATCH] --- yaml --- r: 347846 b: refs/heads/master c: 442e31ca5a49e398351b2954b51f578353fdf210 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 807badab1bff..868814d69cca 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f46d3567b223e41e1f2faeb82d3b74a6d84fc508 +refs/heads/master: 442e31ca5a49e398351b2954b51f578353fdf210 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index b06a111591a8..6868699272bf 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -3626,12 +3626,13 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname, if (flags & AT_SYMLINK_FOLLOW) how |= LOOKUP_FOLLOW; - +retry: error = user_path_at(olddfd, oldname, how, &old_path); if (error) return error; - new_dentry = user_path_create(newdfd, newname, &new_path, 0); + new_dentry = user_path_create(newdfd, newname, &new_path, + (how & LOOKUP_REVAL)); error = PTR_ERR(new_dentry); if (IS_ERR(new_dentry)) goto out; @@ -3648,6 +3649,10 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname, error = vfs_link(old_path.dentry, new_path.dentry->d_inode, new_dentry); out_dput: done_path_create(&new_path, new_dentry); + if (retry_estale(error, how)) { + how |= LOOKUP_REVAL; + goto retry; + } out: path_put(&old_path);