diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-07-11 21:00:04 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-07-12 16:04:13 +0200 |
commit | ea73ea7279884ba80896d4ea0f0443bf48b9e311 (patch) | |
tree | 4fd72a8f638d6c502ccb595e179a453819e18ded /fs/namei.c | |
parent | pass creds to get_empty_filp(), make sure dentry_open() passes the right creds (diff) | |
download | linux-ea73ea7279884ba80896d4ea0f0443bf48b9e311.tar.xz linux-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.c | 4 |
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; |