Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d0728e1 authored by Al Viro's avatar Al Viro
Browse files

atomic_open(): consolidate "overridden ENOENT" in open-yourself cases



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 5249e411
Loading
Loading
Loading
Loading
+1 −8
Original line number Original line Diff line number Diff line
@@ -2908,13 +2908,6 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry,
		}
		}
		if (*opened & FILE_CREATED)
		if (*opened & FILE_CREATED)
			fsnotify_create(dir, dentry);
			fsnotify_create(dir, dentry);
		if (!dentry->d_inode) {
			WARN_ON(*opened & FILE_CREATED);
			if (create_error) {
				error = create_error;
				goto out;
			}
		}
		goto looked_up;
		goto looked_up;
	}
	}


@@ -2942,11 +2935,11 @@ static int atomic_open(struct nameidata *nd, struct dentry *dentry,
		if (IS_ERR(dentry))
		if (IS_ERR(dentry))
			return PTR_ERR(dentry);
			return PTR_ERR(dentry);
	}
	}
looked_up:
	if (create_error && !dentry->d_inode) {
	if (create_error && !dentry->d_inode) {
		error = create_error;
		error = create_error;
		goto out;
		goto out;
	}
	}
looked_up:
	path->dentry = dentry;
	path->dentry = dentry;
	path->mnt = nd->path.mnt;
	path->mnt = nd->path.mnt;
	return 1;
	return 1;