diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-27 15:40:03 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-27 15:40:03 +0100 |
commit | dc1632321ba1e93dde25870e96cebe21b7d52517 (patch) | |
tree | d52d934c79b23f91654c571d983e1a6ec41b71fd /fs/open.c | |
parent | 8c193b8dce4f2a2474dc2bc39ec972454df9d439 (diff) | |
parent | a85f9da707366e856c0aad9e329db0cc59475290 (diff) |
Merge remote-tracking branch 'asoc/topic/dmic' into asoc-core
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/open.c b/fs/open.c index 9156cb050d08..7931f76acc2b 100644 --- a/fs/open.c +++ b/fs/open.c @@ -823,7 +823,7 @@ static inline int build_open_flags(int flags, umode_t mode, struct open_flags *o int lookup_flags = 0; int acc_mode; - if (flags & O_CREAT) + if (flags & (O_CREAT | __O_TMPFILE)) op->mode = (mode & S_IALLUGO) | S_IFREG; else op->mode = 0; @@ -844,6 +844,8 @@ static inline int build_open_flags(int flags, umode_t mode, struct open_flags *o if ((flags & O_TMPFILE_MASK) != O_TMPFILE) return -EINVAL; acc_mode = MAY_OPEN | ACC_MODE(flags); + if (!(acc_mode & MAY_WRITE)) + return -EINVAL; } else if (flags & O_PATH) { /* * If we have O_PATH in the open flag. Then we |