vfs: make do_rmdir retry once on ESTALE errors
authorJeff Layton <jlayton@redhat.com>
Thu, 20 Dec 2012 21:28:33 +0000 (16:28 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 20 Dec 2012 23:50:04 +0000 (18:50 -0500)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index 19190618695f6bad83e983e452d40592d3392b2a..fe06a2fd192578ff0b194ea2d9de3c9df793bc97 100644 (file)
@@ -3339,8 +3339,9 @@ static long do_rmdir(int dfd, const char __user *pathname)
        struct filename *name;
        struct dentry *dentry;
        struct nameidata nd;
-
-       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);
 
@@ -3382,6 +3383,10 @@ exit2:
 exit1:
        path_put(&nd.path);
        putname(name);
+       if (retry_estale(error, lookup_flags)) {
+               lookup_flags |= LOOKUP_REVAL;
+               goto retry;
+       }
        return error;
 }