ocfs2: fix umask ignored issue
authorJunxiao Bi <junxiao.bi@oracle.com>
Fri, 20 Nov 2015 23:57:30 +0000 (15:57 -0800)
committerSasha Levin <sasha.levin@oracle.com>
Thu, 21 Jan 2016 16:23:29 +0000 (11:23 -0500)
[ Upstream commit 8f1eb48758aacf6c1ffce18179295adbf3bd7640 ]

New created file's mode is not masked with umask, and this makes umask not
work for ocfs2 volume.

Fixes: 702e5bc ("ocfs2: use generic posix ACL infrastructure")
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Gang He <ghe@suse.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
fs/ocfs2/namei.c

index 914c121ec8900380482f83728b90f7b0bd14e418..9fc1daecdfb331abaa9c4cee011fdc5378f7ca8e 100644 (file)
@@ -361,6 +361,8 @@ static int ocfs2_mknod(struct inode *dir,
                mlog_errno(status);
                goto leave;
        }
+       /* update inode->i_mode after mask with "umask". */
+       inode->i_mode = mode;
 
        handle = ocfs2_start_trans(osb, ocfs2_mknod_credits(osb->sb,
                                                            S_ISDIR(mode),