aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/resize.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3/resize.c')
-rw-r--r--fs/ext3/resize.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c
index 44de1453c301..9397d779c43d 100644
--- a/fs/ext3/resize.c
+++ b/fs/ext3/resize.c
@@ -518,8 +518,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
518 EXT3_SB(sb)->s_gdb_count++; 518 EXT3_SB(sb)->s_gdb_count++;
519 kfree(o_group_desc); 519 kfree(o_group_desc);
520 520
521 es->s_reserved_gdt_blocks = 521 le16_add_cpu(&es->s_reserved_gdt_blocks, -1);
522 cpu_to_le16(le16_to_cpu(es->s_reserved_gdt_blocks) - 1);
523 ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh); 522 ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh);
524 523
525 return 0; 524 return 0;
@@ -795,12 +794,11 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
795 "No reserved GDT blocks, can't resize"); 794 "No reserved GDT blocks, can't resize");
796 return -EPERM; 795 return -EPERM;
797 } 796 }
798 inode = iget(sb, EXT3_RESIZE_INO); 797 inode = ext3_iget(sb, EXT3_RESIZE_INO);
799 if (!inode || is_bad_inode(inode)) { 798 if (IS_ERR(inode)) {
800 ext3_warning(sb, __FUNCTION__, 799 ext3_warning(sb, __FUNCTION__,
801 "Error opening resize inode"); 800 "Error opening resize inode");
802 iput(inode); 801 return PTR_ERR(inode);
803 return -ENOENT;
804 } 802 }
805 } 803 }
806 804
@@ -891,10 +889,8 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
891 * blocks/inodes before the group is live won't actually let us 889 * blocks/inodes before the group is live won't actually let us
892 * allocate the new space yet. 890 * allocate the new space yet.
893 */ 891 */
894 es->s_blocks_count = cpu_to_le32(le32_to_cpu(es->s_blocks_count) + 892 le32_add_cpu(&es->s_blocks_count, input->blocks_count);
895 input->blocks_count); 893 le32_add_cpu(&es->s_inodes_count, EXT3_INODES_PER_GROUP(sb));
896 es->s_inodes_count = cpu_to_le32(le32_to_cpu(es->s_inodes_count) +
897 EXT3_INODES_PER_GROUP(sb));
898 894
899 /* 895 /*
900 * We need to protect s_groups_count against other CPUs seeing 896 * We need to protect s_groups_count against other CPUs seeing
@@ -927,8 +923,7 @@ int ext3_group_add(struct super_block *sb, struct ext3_new_group_data *input)
927 923
928 /* Update the reserved block counts only once the new group is 924 /* Update the reserved block counts only once the new group is
929 * active. */ 925 * active. */
930 es->s_r_blocks_count = cpu_to_le32(le32_to_cpu(es->s_r_blocks_count) + 926 le32_add_cpu(&es->s_r_blocks_count, input->reserved_blocks);
931 input->reserved_blocks);
932 927
933 /* Update the free space counts */ 928 /* Update the free space counts */
934 percpu_counter_add(&sbi->s_freeblocks_counter, 929 percpu_counter_add(&sbi->s_freeblocks_counter,