aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3')
-rw-r--r--fs/ext3/super.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index c5a52c9775a0..ac5c6b0ecd64 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -1416,6 +1416,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
1416 int i; 1416 int i;
1417 int needs_recovery; 1417 int needs_recovery;
1418 __le32 features; 1418 __le32 features;
1419 int err;
1419 1420
1420 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); 1421 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
1421 if (!sbi) 1422 if (!sbi)
@@ -1675,12 +1676,20 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
1675 get_random_bytes(&sbi->s_next_generation, sizeof(u32)); 1676 get_random_bytes(&sbi->s_next_generation, sizeof(u32));
1676 spin_lock_init(&sbi->s_next_gen_lock); 1677 spin_lock_init(&sbi->s_next_gen_lock);
1677 1678
1678 percpu_counter_init(&sbi->s_freeblocks_counter, 1679 err = percpu_counter_init(&sbi->s_freeblocks_counter,
1679 ext3_count_free_blocks(sb)); 1680 ext3_count_free_blocks(sb));
1680 percpu_counter_init(&sbi->s_freeinodes_counter, 1681 if (!err) {
1681 ext3_count_free_inodes(sb)); 1682 err = percpu_counter_init(&sbi->s_freeinodes_counter,
1682 percpu_counter_init(&sbi->s_dirs_counter, 1683 ext3_count_free_inodes(sb));
1683 ext3_count_dirs(sb)); 1684 }
1685 if (!err) {
1686 err = percpu_counter_init(&sbi->s_dirs_counter,
1687 ext3_count_dirs(sb));
1688 }
1689 if (err) {
1690 printk(KERN_ERR "EXT3-fs: insufficient memory\n");
1691 goto failed_mount3;
1692 }
1684 1693
1685 /* per fileystem reservation list head & lock */ 1694 /* per fileystem reservation list head & lock */
1686 spin_lock_init(&sbi->s_rsv_window_lock); 1695 spin_lock_init(&sbi->s_rsv_window_lock);