diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-12-20 16:00:10 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-20 18:50:02 -0500 |
commit | 972567f14cbcd437e9a88a73836bbc2ee0720b5f (patch) | |
tree | b83652f1c185e6ac727e4eafb5e2201bc249f7cd /fs/namei.c | |
parent | 1ac12b4b6d707937f9de6d09622823b2fd0c93ef (diff) |
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>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 9 |
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, | |||
3172 | struct dentry *dentry; | 3172 | struct dentry *dentry; |
3173 | struct path path; | 3173 | struct path path; |
3174 | int error; | 3174 | int error; |
3175 | unsigned int lookup_flags = 0; | ||
3175 | 3176 | ||
3176 | error = may_mknod(mode); | 3177 | error = may_mknod(mode); |
3177 | if (error) | 3178 | if (error) |
3178 | return error; | 3179 | return error; |
3179 | 3180 | retry: | |
3180 | dentry = user_path_create(dfd, filename, &path, 0); | 3181 | dentry = user_path_create(dfd, filename, &path, lookup_flags); |
3181 | if (IS_ERR(dentry)) | 3182 | if (IS_ERR(dentry)) |
3182 | return PTR_ERR(dentry); | 3183 | return PTR_ERR(dentry); |
3183 | 3184 | ||
@@ -3200,6 +3201,10 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode, | |||
3200 | } | 3201 | } |
3201 | out: | 3202 | out: |
3202 | done_path_create(&path, dentry); | 3203 | done_path_create(&path, dentry); |
3204 | if (retry_estale(error, lookup_flags)) { | ||
3205 | lookup_flags |= LOOKUP_REVAL; | ||
3206 | goto retry; | ||
3207 | } | ||
3203 | return error; | 3208 | return error; |
3204 | } | 3209 | } |
3205 | 3210 | ||