aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-07-11 15:00:04 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-07-12 10:04:13 -0400
commitea73ea7279884ba80896d4ea0f0443bf48b9e311 (patch)
tree4fd72a8f638d6c502ccb595e179a453819e18ded /fs/namei.c
parentpass creds to get_empty_filp(), make sure dentry_open() passes the right creds (diff)
downloadlinux-dev-ea73ea7279884ba80896d4ea0f0443bf48b9e311.tar.xz
linux-dev-ea73ea7279884ba80896d4ea0f0443bf48b9e311.zip
pass ->f_flags value to alloc_empty_file()
... and have it set the f_flags-derived part of ->f_mode. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c
index af2ec1803f57..223925e30adb 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -3513,12 +3513,10 @@ static struct file *path_openat(struct nameidata *nd,
int opened = 0;
int error;
- file = alloc_empty_file(current_cred());
+ file = alloc_empty_file(op->open_flag, current_cred());
if (IS_ERR(file))
return file;
- file->f_flags = op->open_flag;
-
if (unlikely(file->f_flags & __O_TMPFILE)) {
error = do_tmpfile(nd, flags, op, file, &opened);
goto out2;