Skip to content

Commit

Permalink
vfs: make do_unlinkat retry once on ESTALE errors
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Jeff Layton authored and Al Viro committed Dec 20, 2012
1 parent c6ee920 commit 5d18f81
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -3440,8 +3440,9 @@ static long do_unlinkat(int dfd, const char __user *pathname)
struct dentry *dentry;
struct nameidata nd;
struct inode *inode = NULL;

name = user_path_parent(dfd, pathname, &nd, 0);
unsigned int lookup_flags = 0;
retry:
name = user_path_parent(dfd, pathname, &nd, lookup_flags);
if (IS_ERR(name))
return PTR_ERR(name);

Expand Down Expand Up @@ -3479,6 +3480,11 @@ static long do_unlinkat(int dfd, const char __user *pathname)
exit1:
path_put(&nd.path);
putname(name);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
inode = NULL;
goto retry;
}
return error;

slashes:
Expand Down

0 comments on commit 5d18f81

Please sign in to comment.