From 32e66332301c671592c4de18998b34a4085dc529 Mon Sep 17 00:00:00 2001 From: Dmitry Monakhov Date: Thu, 4 Mar 2010 17:31:50 +0300 Subject: [PATCH] --- yaml --- r: 197979 b: refs/heads/master c: aab99c2c26f74d90f615fcca534172dfc1c8bec2 h: refs/heads/master i: 197977: 38a74034342efa59f482073928d3799c8ab3e2b4 197975: b669787a6665cca70b26fde81bcdad5a46b11b05 v: v3 --- [refs] | 2 +- trunk/fs/ext3/ialloc.c | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 74bfb42b4f2b..8f4e053557f5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ffba102d75a2e79ac9754841c6cf4a6dd6892c42 +refs/heads/master: aab99c2c26f74d90f615fcca534172dfc1c8bec2 diff --git a/trunk/fs/ext3/ialloc.c b/trunk/fs/ext3/ialloc.c index 0d0e97ed3ff6..498021eb88fb 100644 --- a/trunk/fs/ext3/ialloc.c +++ b/trunk/fs/ext3/ialloc.c @@ -538,16 +538,13 @@ struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, int mode) if (S_ISDIR(mode)) percpu_counter_inc(&sbi->s_dirs_counter); - inode->i_uid = current_fsuid(); - if (test_opt (sb, GRPID)) - inode->i_gid = dir->i_gid; - else if (dir->i_mode & S_ISGID) { + + if (test_opt(sb, GRPID)) { + inode->i_mode = mode; + inode->i_uid = current_fsuid(); inode->i_gid = dir->i_gid; - if (S_ISDIR(mode)) - mode |= S_ISGID; } else - inode->i_gid = current_fsgid(); - inode->i_mode = mode; + inode_init_owner(inode, dir, mode); inode->i_ino = ino; /* This is the optimal IO size (for stat), not the fs block size */