Don't pass mangled open_flag to finish_open()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
a2c36b450e
commit
9a66179e13
@ -1591,13 +1591,13 @@ static int open_will_truncate(int flag, struct inode *inode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct file *finish_open(struct nameidata *nd,
|
static struct file *finish_open(struct nameidata *nd,
|
||||||
int open_flag, int flag, int acc_mode)
|
int open_flag, int acc_mode)
|
||||||
{
|
{
|
||||||
struct file *filp;
|
struct file *filp;
|
||||||
int will_truncate;
|
int will_truncate;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
will_truncate = open_will_truncate(flag, nd->path.dentry->d_inode);
|
will_truncate = open_will_truncate(open_flag, nd->path.dentry->d_inode);
|
||||||
if (will_truncate) {
|
if (will_truncate) {
|
||||||
error = mnt_want_write(nd->path.mnt);
|
error = mnt_want_write(nd->path.mnt);
|
||||||
if (error)
|
if (error)
|
||||||
@ -1733,7 +1733,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
|
|||||||
error = -EISDIR;
|
error = -EISDIR;
|
||||||
if (S_ISDIR(path->dentry->d_inode->i_mode))
|
if (S_ISDIR(path->dentry->d_inode->i_mode))
|
||||||
goto exit;
|
goto exit;
|
||||||
filp = finish_open(nd, open_flag, flag, acc_mode);
|
filp = finish_open(nd, open_flag, acc_mode);
|
||||||
return filp;
|
return filp;
|
||||||
|
|
||||||
exit_mutex_unlock:
|
exit_mutex_unlock:
|
||||||
@ -1854,7 +1854,7 @@ reval:
|
|||||||
return filp;
|
return filp;
|
||||||
|
|
||||||
ok:
|
ok:
|
||||||
filp = finish_open(&nd, open_flag, flag, acc_mode);
|
filp = finish_open(&nd, open_flag, acc_mode);
|
||||||
if (nd.root.mnt)
|
if (nd.root.mnt)
|
||||||
path_put(&nd.root);
|
path_put(&nd.root);
|
||||||
return filp;
|
return filp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user