summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-12-20 22:00:10 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2012-12-21 00:50:02 +0100
commit972567f14cbcd437e9a88a73836bbc2ee0720b5f (patch)
treeb83652f1c185e6ac727e4eafb5e2201bc249f7cd
parentvfs: turn is_dir argument to kern_path_create into a lookup_flags arg (diff)
downloadlinux-972567f14cbcd437e9a88a73836bbc2ee0720b5f.tar.xz
linux-972567f14cbcd437e9a88a73836bbc2ee0720b5f.zip
vfs: fix mknodat to retry on ESTALE errors
Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/namei.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 8f8e41f6eb52..b70c191b7e2b 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3172,12 +3172,13 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
struct dentry *dentry;
struct path path;
int error;
+ unsigned int lookup_flags = 0;
error = may_mknod(mode);
if (error)
return error;
-
- dentry = user_path_create(dfd, filename, &path, 0);
+retry:
+ dentry = user_path_create(dfd, filename, &path, lookup_flags);
if (IS_ERR(dentry))
return PTR_ERR(dentry);
@@ -3200,6 +3201,10 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
}
out:
done_path_create(&path, dentry);
+ if (retry_estale(error, lookup_flags)) {
+ lookup_flags |= LOOKUP_REVAL;
+ goto retry;
+ }
return error;
}