diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-12-20 16:38:04 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-20 18:50:04 -0500 |
commit | 5d18f8133cad85ccbb7fa6fd351d75025da32504 (patch) | |
tree | 41ecbcbe72dbaba82973cac973e262459927a9df /fs | |
parent | c6ee920698301febdf10df0b57039173a1edbd43 (diff) |
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')
-rw-r--r-- | fs/namei.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c index fe06a2fd1925..8a262c2efff8 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -3440,8 +3440,9 @@ static long do_unlinkat(int dfd, const char __user *pathname) | |||
3440 | struct dentry *dentry; | 3440 | struct dentry *dentry; |
3441 | struct nameidata nd; | 3441 | struct nameidata nd; |
3442 | struct inode *inode = NULL; | 3442 | struct inode *inode = NULL; |
3443 | 3443 | unsigned int lookup_flags = 0; | |
3444 | name = user_path_parent(dfd, pathname, &nd, 0); | 3444 | retry: |
3445 | name = user_path_parent(dfd, pathname, &nd, lookup_flags); | ||
3445 | if (IS_ERR(name)) | 3446 | if (IS_ERR(name)) |
3446 | return PTR_ERR(name); | 3447 | return PTR_ERR(name); |
3447 | 3448 | ||
@@ -3479,6 +3480,11 @@ exit2: | |||
3479 | exit1: | 3480 | exit1: |
3480 | path_put(&nd.path); | 3481 | path_put(&nd.path); |
3481 | putname(name); | 3482 | putname(name); |
3483 | if (retry_estale(error, lookup_flags)) { | ||
3484 | lookup_flags |= LOOKUP_REVAL; | ||
3485 | inode = NULL; | ||
3486 | goto retry; | ||
3487 | } | ||
3482 | return error; | 3488 | return error; |
3483 | 3489 | ||
3484 | slashes: | 3490 | slashes: |