From: Jeff Layton Date: Thu, 20 Dec 2012 21:04:09 +0000 (-0500) Subject: vfs: fix mkdirat to retry once on an ESTALE error X-Git-Tag: v3.8-rc1~13^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b76d8b82266077dc7098dd13f321a616099a1bd8;p=profile%2Fcommon%2Fkernel-common.git vfs: fix mkdirat to retry once on an ESTALE error Signed-off-by: Jeff Layton Signed-off-by: Al Viro --- diff --git a/fs/namei.c b/fs/namei.c index b70c191..1beebc1 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3243,8 +3243,10 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode) struct dentry *dentry; struct path path; int error; + unsigned int lookup_flags = LOOKUP_DIRECTORY; - dentry = user_path_create(dfd, pathname, &path, LOOKUP_DIRECTORY); +retry: + dentry = user_path_create(dfd, pathname, &path, lookup_flags); if (IS_ERR(dentry)) return PTR_ERR(dentry); @@ -3254,6 +3256,10 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode) if (!error) error = vfs_mkdir(path.dentry->d_inode, dentry, mode); done_path_create(&path, dentry); + if (retry_estale(error, lookup_flags)) { + lookup_flags |= LOOKUP_REVAL; + goto retry; + } return error; }