vfs: allow utimensat() calls to retry once on an ESTALE error
authorJeff Layton <jlayton@redhat.com>
Tue, 11 Dec 2012 17:10:14 +0000 (12:10 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 20 Dec 2012 23:50:08 +0000 (18:50 -0500)
Clearly, we can't handle the NULL filename case, but we can deal with
the case where there's a real pathname.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/utimes.c

index bb0696a41735608512963ae1648a79a9d7b0bd27..f4fb7eca10e832f5b9c4405092627b94f4a163dc 100644 (file)
@@ -158,13 +158,17 @@ long do_utimes(int dfd, const char __user *filename, struct timespec *times,
 
                if (!(flags & AT_SYMLINK_NOFOLLOW))
                        lookup_flags |= LOOKUP_FOLLOW;
-
+retry:
                error = user_path_at(dfd, filename, lookup_flags, &path);
                if (error)
                        goto out;
 
                error = utimes_common(&path, times);
                path_put(&path);
+               if (retry_estale(error, lookup_flags)) {
+                       lookup_flags |= LOOKUP_REVAL;
+                       goto retry;
+               }
        }
 
 out: