aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/open.c b/fs/open.c
index b6f1e96a7c0b..b25b1542c530 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -887,7 +887,7 @@ EXPORT_SYMBOL(dentry_open);
887static inline int build_open_flags(int flags, umode_t mode, struct open_flags *op) 887static inline int build_open_flags(int flags, umode_t mode, struct open_flags *op)
888{ 888{
889 int lookup_flags = 0; 889 int lookup_flags = 0;
890 int acc_mode; 890 int acc_mode = ACC_MODE(flags);
891 891
892 if (flags & (O_CREAT | __O_TMPFILE)) 892 if (flags & (O_CREAT | __O_TMPFILE))
893 op->mode = (mode & S_IALLUGO) | S_IFREG; 893 op->mode = (mode & S_IALLUGO) | S_IFREG;
@@ -909,7 +909,6 @@ static inline int build_open_flags(int flags, umode_t mode, struct open_flags *o
909 if (flags & __O_TMPFILE) { 909 if (flags & __O_TMPFILE) {
910 if ((flags & O_TMPFILE_MASK) != O_TMPFILE) 910 if ((flags & O_TMPFILE_MASK) != O_TMPFILE)
911 return -EINVAL; 911 return -EINVAL;
912 acc_mode = MAY_OPEN | ACC_MODE(flags);
913 if (!(acc_mode & MAY_WRITE)) 912 if (!(acc_mode & MAY_WRITE))
914 return -EINVAL; 913 return -EINVAL;
915 } else if (flags & O_PATH) { 914 } else if (flags & O_PATH) {
@@ -919,8 +918,6 @@ static inline int build_open_flags(int flags, umode_t mode, struct open_flags *o
919 */ 918 */
920 flags &= O_DIRECTORY | O_NOFOLLOW | O_PATH; 919 flags &= O_DIRECTORY | O_NOFOLLOW | O_PATH;
921 acc_mode = 0; 920 acc_mode = 0;
922 } else {
923 acc_mode = MAY_OPEN | ACC_MODE(flags);
924 } 921 }
925 922
926 op->open_flag = flags; 923 op->open_flag = flags;