diff options
Diffstat (limited to 'fs/ext4/ialloc.c')
-rw-r--r-- | fs/ext4/ialloc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 7f6b5826d5a6..25c4b3173fd9 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -972,16 +972,12 @@ got: | |||
972 | atomic_dec(&sbi->s_flex_groups[flex_group].free_inodes); | 972 | atomic_dec(&sbi->s_flex_groups[flex_group].free_inodes); |
973 | } | 973 | } |
974 | 974 | ||
975 | inode->i_uid = current_fsuid(); | 975 | if (test_opt(sb, GRPID)) { |
976 | if (test_opt(sb, GRPID)) | 976 | inode->i_mode = mode; |
977 | inode->i_uid = current_fsuid(); | ||
977 | inode->i_gid = dir->i_gid; | 978 | inode->i_gid = dir->i_gid; |
978 | else if (dir->i_mode & S_ISGID) { | ||
979 | inode->i_gid = dir->i_gid; | ||
980 | if (S_ISDIR(mode)) | ||
981 | mode |= S_ISGID; | ||
982 | } else | 979 | } else |
983 | inode->i_gid = current_fsgid(); | 980 | inode_init_owner(inode, dir, mode); |
984 | inode->i_mode = mode; | ||
985 | 981 | ||
986 | inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb); | 982 | inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb); |
987 | /* This is the optimal IO size (for stat), not the fs block size */ | 983 | /* This is the optimal IO size (for stat), not the fs block size */ |