From: Andy Lutomirski Date: Fri, 2 Aug 2013 04:07:52 +0000 (-0700) Subject: fs: Fix file mode for O_TMPFILE X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e305f48bc453da773a3601135a2cce40b8e62856;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git fs: Fix file mode for O_TMPFILE O_TMPFILE, like O_CREAT, should respect the requested mode and should create regular files. This fixes two bugs: O_TMPFILE required privilege (because the mode ended up as 000) and it produced bogus inodes with no type. Signed-off-by: Andy Lutomirski Signed-off-by: Al Viro --- diff --git a/fs/open.c b/fs/open.c index d53e29895082..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;