We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e00117f commit ffba102Copy full SHA for ffba102
fs/ext2/ialloc.c
@@ -549,16 +549,12 @@ struct inode *ext2_new_inode(struct inode *dir, int mode)
549
550
sb->s_dirt = 1;
551
mark_buffer_dirty(bh2);
552
- inode->i_uid = current_fsuid();
553
- if (test_opt (sb, GRPID))
+ if (test_opt(sb, GRPID)) {
+ inode->i_mode = mode;
554
+ inode->i_uid = current_fsuid();
555
inode->i_gid = dir->i_gid;
- else if (dir->i_mode & S_ISGID) {
556
- inode->i_gid = dir->i_gid;
557
- if (S_ISDIR(mode))
558
- mode |= S_ISGID;
559
} else
560
- inode->i_gid = current_fsgid();
561
- inode->i_mode = mode;
+ inode_init_owner(inode, dir, mode);
562
563
inode->i_ino = ino;
564
inode->i_blocks = 0;
0 commit comments