atomic_open(): consolidate "overridden ENOENT" in open-yourself cases
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 27 Apr 2016 20:52:17 +0000 (16:52 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 2 May 2016 23:51:12 +0000 (19:51 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index eec7c0aa446d5136539b0981db3c5a0e4160ca2e..36520fc237469ed2887adb492137e66d8dc6f8e1 100644 (file)
@@ -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 @@ no_open:
                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;