summaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-12-20 16:38:04 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-12-20 18:50:04 -0500
commit5d18f8133cad85ccbb7fa6fd351d75025da32504 (patch)
tree41ecbcbe72dbaba82973cac973e262459927a9df /fs/namei.c
parentc6ee920698301febdf10df0b57039173a1edbd43 (diff)
downloadrenesas_kernel-5d18f8133cad85ccbb7fa6fd351d75025da32504.tar.gz
renesas_kernel-5d18f8133cad85ccbb7fa6fd351d75025da32504.tar.bz2
renesas_kernel-5d18f8133cad85ccbb7fa6fd351d75025da32504.zip
vfs: make do_unlinkat retry once 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/namei.c')
-rw-r--r--fs/namei.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index fe06a2fd192..8a262c2efff 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -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);
@@ -3479,6 +3480,11 @@ exit2:
exit1:
path_put(&nd.path);
putname(name);
+ if (retry_estale(error, lookup_flags)) {
+ lookup_flags |= LOOKUP_REVAL;
+ inode = NULL;
+ goto retry;
+ }
return error;
slashes: