diff -urN ext2-1/fs/ext2/namei.c ext2-2/fs/ext2/namei.c --- ext2-1/fs/ext2/namei.c Fri Dec 1 10:35:24 2000 +++ ext2-2/fs/ext2/namei.c Fri Dec 1 10:37:32 2000 @@ -369,7 +369,6 @@ inode->i_op = &ext2_file_inode_operations; inode->i_fop = &ext2_file_operations; inode->i_mapping->a_ops = &ext2_aops; - inode->i_mode = mode; mark_inode_dirty(inode); err = ext2_add_entry (dir, dentry->d_name.name, dentry->d_name.len, inode); @@ -418,7 +417,10 @@ if (dir->i_nlink >= EXT2_LINK_MAX) return -EMLINK; - inode = ext2_new_inode (dir, S_IFDIR); + if (dir->i_mode & S_ISGID) + mode |= S_ISGID; + + inode = ext2_new_inode (dir, S_IFDIR | mode); err = PTR_ERR(inode); if (IS_ERR(inode)) return err; @@ -426,7 +428,6 @@ inode->i_op = &ext2_dir_inode_operations; inode->i_fop = &ext2_dir_operations; inode->i_size = inode->i_sb->s_blocksize; - inode->i_blocks = 0; dir_block = ext2_bread (inode, 0, 1, &err); if (!dir_block) { inode->i_nlink--; /* is this nlink == 0? */ @@ -449,9 +450,6 @@ inode->i_nlink = 2; mark_buffer_dirty_inode(dir_block, dir); brelse (dir_block); - inode->i_mode = S_IFDIR | mode; - if (dir->i_mode & S_ISGID) - inode->i_mode |= S_ISGID; mark_inode_dirty(inode); err = ext2_add_entry (dir, dentry->d_name.name, dentry->d_name.len, inode); @@ -626,12 +624,10 @@ if (l > dir->i_sb->s_blocksize) return -ENAMETOOLONG; - inode = ext2_new_inode (dir, S_IFLNK); + inode = ext2_new_inode (dir, S_IFLNK|S_IRWXUGO); err = PTR_ERR(inode); if (IS_ERR(inode)) return err; - - inode->i_mode = S_IFLNK | S_IRWXUGO; if (l > sizeof (inode->u.ext2_i.i_data)) { inode->i_op = &page_symlink_inode_operations;