Skip to content

Commit ffba102

Browse files
Dmitry MonakhovAl Viro
Dmitry Monakhov
authored and
Al Viro
committed
ext2: replace inode uid,gid,mode init with helper
Acked-by: Jan Kara <[email protected]> Signed-off-by: Dmitry Monakhov <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent e00117f commit ffba102

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

fs/ext2/ialloc.c

+4-8
Original file line numberDiff line numberDiff line change
@@ -549,16 +549,12 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
549549

550550
sb->s_dirt = 1;
551551
mark_buffer_dirty(bh2);
552-
inode->i_uid = current_fsuid();
553-
if (test_opt (sb, GRPID))
552+
if (test_opt(sb, GRPID)) {
553+
inode->i_mode = mode;
554+
inode->i_uid = current_fsuid();
554555
inode->i_gid = dir->i_gid;
555-
else if (dir->i_mode & S_ISGID) {
556-
inode->i_gid = dir->i_gid;
557-
if (S_ISDIR(mode))
558-
mode |= S_ISGID;
559556
} else
560-
inode->i_gid = current_fsgid();
561-
inode->i_mode = mode;
557+
inode_init_owner(inode, dir, mode);
562558

563559
inode->i_ino = ino;
564560
inode->i_blocks = 0;

0 commit comments

Comments
 (0)