aboutsummaryrefslogtreecommitdiff
path: root/fs/open.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-25 13:37:05 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-25 13:37:05 +0100
commit8e5d0661b3948f3c5a143f32d192710375822af2 (patch)
treeca18920d3f7219f7ffb7ca2fa372b82558938006 /fs/open.c
parent39a6ac11df6579df0361922f05c43f0fac8daa37 (diff)
parent5698bd757d55b1bb87edd1a9744ab09c142abfc2 (diff)
Merge tag 'v3.6-rc6' into spi-drivers
Linux 3.6-rc6 Conflicts: drivers/spi/spi-omap2-mcspi.c
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/open.c b/fs/open.c
index bc132e167d2..e1f2cdb91a4 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -852,9 +852,10 @@ 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))
- mode = 0;
- op->mode = mode;
+ if (flags & O_CREAT)
+ op->mode = (mode & S_IALLUGO) | S_IFREG;
+ else
+ op->mode = 0;
/* Must never be set by userspace */
flags &= ~FMODE_NONOTIFY;