diff options
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/namei.c b/fs/namei.c index b05a2b1dea64..c82805d088e1 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -1131,8 +1131,8 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt, | |||
1131 | * @nd: pointer to nameidata | 1131 | * @nd: pointer to nameidata |
1132 | * @open_flags: open intent flags | 1132 | * @open_flags: open intent flags |
1133 | */ | 1133 | */ |
1134 | int path_lookup_open(int dfd, const char *name, unsigned int lookup_flags, | 1134 | static int path_lookup_open(int dfd, const char *name, |
1135 | struct nameidata *nd, int open_flags) | 1135 | unsigned int lookup_flags, struct nameidata *nd, int open_flags) |
1136 | { | 1136 | { |
1137 | struct file *filp = get_empty_filp(); | 1137 | struct file *filp = get_empty_filp(); |
1138 | int err; | 1138 | int err; |
@@ -1639,18 +1639,19 @@ static int open_will_write_to_fs(int flag, struct inode *inode) | |||
1639 | * open_to_namei_flags() for more details. | 1639 | * open_to_namei_flags() for more details. |
1640 | */ | 1640 | */ |
1641 | struct file *do_filp_open(int dfd, const char *pathname, | 1641 | struct file *do_filp_open(int dfd, const char *pathname, |
1642 | int open_flag, int mode) | 1642 | int open_flag, int mode, int acc_mode) |
1643 | { | 1643 | { |
1644 | struct file *filp; | 1644 | struct file *filp; |
1645 | struct nameidata nd; | 1645 | struct nameidata nd; |
1646 | int acc_mode, error; | 1646 | int error; |
1647 | struct path path; | 1647 | struct path path; |
1648 | struct dentry *dir; | 1648 | struct dentry *dir; |
1649 | int count = 0; | 1649 | int count = 0; |
1650 | int will_write; | 1650 | int will_write; |
1651 | int flag = open_to_namei_flags(open_flag); | 1651 | int flag = open_to_namei_flags(open_flag); |
1652 | 1652 | ||
1653 | acc_mode = MAY_OPEN | ACC_MODE(flag); | 1653 | if (!acc_mode) |
1654 | acc_mode = MAY_OPEN | ACC_MODE(flag); | ||
1654 | 1655 | ||
1655 | /* O_TRUNC implies we need access checks for write permissions */ | 1656 | /* O_TRUNC implies we need access checks for write permissions */ |
1656 | if (flag & O_TRUNC) | 1657 | if (flag & O_TRUNC) |
@@ -1871,7 +1872,7 @@ do_link: | |||
1871 | */ | 1872 | */ |
1872 | struct file *filp_open(const char *filename, int flags, int mode) | 1873 | struct file *filp_open(const char *filename, int flags, int mode) |
1873 | { | 1874 | { |
1874 | return do_filp_open(AT_FDCWD, filename, flags, mode); | 1875 | return do_filp_open(AT_FDCWD, filename, flags, mode, 0); |
1875 | } | 1876 | } |
1876 | EXPORT_SYMBOL(filp_open); | 1877 | EXPORT_SYMBOL(filp_open); |
1877 | 1878 | ||