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