aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/ialloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3/ialloc.c')
-rw-r--r--fs/ext3/ialloc.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
index 0d0e97ed3ff6..4ab72db3559e 100644
--- a/fs/ext3/ialloc.c
+++ b/fs/ext3/ialloc.c
@@ -119,20 +119,8 @@ void ext3_free_inode (handle_t *handle, struct inode * inode)
119 ino = inode->i_ino; 119 ino = inode->i_ino;
120 ext3_debug ("freeing inode %lu\n", ino); 120 ext3_debug ("freeing inode %lu\n", ino);
121 121
122 /*
123 * Note: we must free any quota before locking the superblock,
124 * as writing the quota to disk may need the lock as well.
125 */
126 dquot_initialize(inode);
127 ext3_xattr_delete_inode(handle, inode);
128 dquot_free_inode(inode);
129 dquot_drop(inode);
130
131 is_directory = S_ISDIR(inode->i_mode); 122 is_directory = S_ISDIR(inode->i_mode);
132 123
133 /* Do this BEFORE marking the inode not in use or returning an error */
134 clear_inode (inode);
135
136 es = EXT3_SB(sb)->s_es; 124 es = EXT3_SB(sb)->s_es;
137 if (ino < EXT3_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) { 125 if (ino < EXT3_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) {
138 ext3_error (sb, "ext3_free_inode", 126 ext3_error (sb, "ext3_free_inode",
@@ -538,16 +526,13 @@ got:
538 if (S_ISDIR(mode)) 526 if (S_ISDIR(mode))
539 percpu_counter_inc(&sbi->s_dirs_counter); 527 percpu_counter_inc(&sbi->s_dirs_counter);
540 528
541 inode->i_uid = current_fsuid(); 529
542 if (test_opt (sb, GRPID)) 530 if (test_opt(sb, GRPID)) {
543 inode->i_gid = dir->i_gid; 531 inode->i_mode = mode;
544 else if (dir->i_mode & S_ISGID) { 532 inode->i_uid = current_fsuid();
545 inode->i_gid = dir->i_gid; 533 inode->i_gid = dir->i_gid;
546 if (S_ISDIR(mode))
547 mode |= S_ISGID;
548 } else 534 } else
549 inode->i_gid = current_fsgid(); 535 inode_init_owner(inode, dir, mode);
550 inode->i_mode = mode;
551 536
552 inode->i_ino = ino; 537 inode->i_ino = ino;
553 /* This is the optimal IO size (for stat), not the fs block size */ 538 /* This is the optimal IO size (for stat), not the fs block size */