diff options
| -rw-r--r-- | fs/ext2/ialloc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index f0c5286f9342..938dbc739d00 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c | |||
| @@ -549,16 +549,12 @@ got: | |||
| 549 | 549 | ||
| 550 | sb->s_dirt = 1; | 550 | sb->s_dirt = 1; |
| 551 | mark_buffer_dirty(bh2); | 551 | mark_buffer_dirty(bh2); |
| 552 | inode->i_uid = current_fsuid(); | 552 | if (test_opt(sb, GRPID)) { |
| 553 | if (test_opt (sb, GRPID)) | 553 | inode->i_mode = mode; |
| 554 | inode->i_uid = current_fsuid(); | ||
| 554 | inode->i_gid = dir->i_gid; | 555 | 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; | ||
| 559 | } else | 556 | } else |
| 560 | inode->i_gid = current_fsgid(); | 557 | inode_init_owner(inode, dir, mode); |
| 561 | inode->i_mode = mode; | ||
| 562 | 558 | ||
| 563 | inode->i_ino = ino; | 559 | inode->i_ino = ino; |
| 564 | inode->i_blocks = 0; | 560 | inode->i_blocks = 0; |
