Commit c6ee920698301febdf10df0b57039173a1edbd43
Committed by
Al Viro
1 parent
9e790bd65c
Exists in
master
and in
20 other branches
vfs: make do_rmdir retry once on ESTALE errors
Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 1 changed file with 7 additions and 2 deletions Side-by-side Diff
fs/namei.c
... | ... | @@ -3339,8 +3339,9 @@ |
3339 | 3339 | struct filename *name; |
3340 | 3340 | struct dentry *dentry; |
3341 | 3341 | struct nameidata nd; |
3342 | - | |
3343 | - name = user_path_parent(dfd, pathname, &nd, 0); | |
3342 | + unsigned int lookup_flags = 0; | |
3343 | +retry: | |
3344 | + name = user_path_parent(dfd, pathname, &nd, lookup_flags); | |
3344 | 3345 | if (IS_ERR(name)) |
3345 | 3346 | return PTR_ERR(name); |
3346 | 3347 | |
... | ... | @@ -3382,6 +3383,10 @@ |
3382 | 3383 | exit1: |
3383 | 3384 | path_put(&nd.path); |
3384 | 3385 | putname(name); |
3386 | + if (retry_estale(error, lookup_flags)) { | |
3387 | + lookup_flags |= LOOKUP_REVAL; | |
3388 | + goto retry; | |
3389 | + } | |
3385 | 3390 | return error; |
3386 | 3391 | } |
3387 | 3392 |