From 9d0728e16e9269f368a6217b34166999c8ba2f3e Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Wed, 27 Apr 2016 16:52:17 -0400
Subject: [PATCH] atomic_open(): consolidate "overridden ENOENT" in
 open-yourself cases

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/namei.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index eec7c0aa446d..36520fc23746 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2908,13 +2908,6 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry,
 		}
 		if (*opened & FILE_CREATED)
 			fsnotify_create(dir, dentry);
-		if (!dentry->d_inode) {
-			WARN_ON(*opened & FILE_CREATED);
-			if (create_error) {
-				error = create_error;
-				goto out;
-			}
-		}
 		goto looked_up;
 	}
 
@@ -2942,11 +2935,11 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry,
 		if (IS_ERR(dentry))
 			return PTR_ERR(dentry);
 	}
+looked_up:
 	if (create_error && !dentry->d_inode) {
 		error = create_error;
 		goto out;
 	}
-looked_up:
 	path->dentry = dentry;
 	path->mnt = nd->path.mnt;
 	return 1;
-- 
GitLab