summaryrefslogtreecommitdiff
path: root/fs/open.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-27 14:13:33 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-27 14:13:33 (GMT)
commite372dc6c62bf0246a07f3291a26c562cc8659fbd (patch)
treec7039c1d1005b80e427761ba768d7697ae4a0b72 /fs/open.c
parent5d4121c04b3577e37e389b3553d442f44bb346d7 (diff)
parentfea7a08acb13524b47711625eebea40a0ede69a0 (diff)
downloadlinux-fsl-qoriq-e372dc6c62bf0246a07f3291a26c562cc8659fbd.tar.xz
Merge 3.6-rc3 into tty-next
This picks up all of the different fixes in Linus's tree that we also need here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/open.c b/fs/open.c
index f3d96e7..e1f2cdb 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -717,7 +717,7 @@ cleanup_all:
* here, so just reset the state.
*/
file_reset_write(f);
- mnt_drop_write(f->f_path.mnt);
+ __mnt_drop_write(f->f_path.mnt);
}
}
cleanup_file:
@@ -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;