Commit aab99c2c26f74d90f615fcca534172dfc1c8bec2
Committed by
Al Viro
1 parent
ffba102d75
Exists in
master
and in
7 other branches
ext3: replace inode uid,gid,mode init with helper
Acked-by: Jan Kara <jack@suse.cz> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 1 changed file with 5 additions and 8 deletions Side-by-side Diff
fs/ext3/ialloc.c
... | ... | @@ -538,16 +538,13 @@ |
538 | 538 | if (S_ISDIR(mode)) |
539 | 539 | percpu_counter_inc(&sbi->s_dirs_counter); |
540 | 540 | |
541 | - inode->i_uid = current_fsuid(); | |
542 | - if (test_opt (sb, GRPID)) | |
541 | + | |
542 | + if (test_opt(sb, GRPID)) { | |
543 | + inode->i_mode = mode; | |
544 | + inode->i_uid = current_fsuid(); | |
543 | 545 | inode->i_gid = dir->i_gid; |
544 | - else if (dir->i_mode & S_ISGID) { | |
545 | - inode->i_gid = dir->i_gid; | |
546 | - if (S_ISDIR(mode)) | |
547 | - mode |= S_ISGID; | |
548 | 546 | } else |
549 | - inode->i_gid = current_fsgid(); | |
550 | - inode->i_mode = mode; | |
547 | + inode_init_owner(inode, dir, mode); | |
551 | 548 | |
552 | 549 | inode->i_ino = ino; |
553 | 550 | /* This is the optimal IO size (for stat), not the fs block size */ |