X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fext3%2Fsuper.c;h=b5850a96155497fe0f52e91fa39a3fb7e6bfed91;hb=9e1bf581d67d87a1d7fc0ea500729e3a03643a26;hp=9f8a821c6114df54a4b22d0a6044a0ccee9de130;hpb=8d40237c730b8be87c1b80a5d96b9c603fefa829;p=linux-2.6.git diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 9f8a821c6..b5850a961 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -1294,8 +1294,13 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) es = (struct ext3_super_block *) (((char *)bh->b_data) + offset); sbi->s_es = es; sb->s_magic = le16_to_cpu(es->s_magic); - if (sb->s_magic != EXT3_SUPER_MAGIC) - goto cantfind_ext3; + if (sb->s_magic != EXT3_SUPER_MAGIC) { + if (!silent) + printk(KERN_ERR + "VFS: Can't find ext3 filesystem on dev %s.\n", + sb->s_id); + goto failed_mount; + } /* Set defaults before we parse the mount options */ def_mount_opts = le32_to_cpu(es->s_default_mount_opts); @@ -1431,13 +1436,8 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group); sbi->s_frags_per_group = le32_to_cpu(es->s_frags_per_group); sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group); - if (EXT3_INODE_SIZE(sb) == 0) - goto cantfind_ext3; sbi->s_inodes_per_block = blocksize / EXT3_INODE_SIZE(sb); - if (sbi->s_inodes_per_block == 0) - goto cantfind_ext3; - sbi->s_itb_per_group = sbi->s_inodes_per_group / - sbi->s_inodes_per_block; + sbi->s_itb_per_group = sbi->s_inodes_per_group /sbi->s_inodes_per_block; sbi->s_desc_per_block = blocksize / sizeof(struct ext3_group_desc); sbi->s_sbh = bh; sbi->s_mount_state = le16_to_cpu(es->s_state); @@ -1466,8 +1466,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) goto failed_mount; } - if (EXT3_BLOCKS_PER_GROUP(sb) == 0) - goto cantfind_ext3; sbi->s_groups_count = (le32_to_cpu(es->s_blocks_count) - le32_to_cpu(es->s_first_data_block) + EXT3_BLOCKS_PER_GROUP(sb) - 1) / @@ -1514,8 +1512,8 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) sbi->s_rsv_window_head.rsv_end = EXT3_RESERVE_WINDOW_NOT_ALLOCATED; atomic_set(&sbi->s_rsv_window_head.rsv_alloc_hit, 0); atomic_set(&sbi->s_rsv_window_head.rsv_goal_size, 0); - ext3_rsv_window_add(sb, &sbi->s_rsv_window_head); - + rsv_window_add(sb, &sbi->s_rsv_window_head); + /* * set up enough so that it can read an inode */ @@ -1627,12 +1625,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) return 0; -cantfind_ext3: - if (!silent) - printk(KERN_ERR "VFS: Can't find ext3 filesystem on dev %s.\n", - sb->s_id); - goto failed_mount; - failed_mount3: journal_destroy(sbi->s_journal); failed_mount2: @@ -1641,8 +1633,10 @@ failed_mount2: kfree(sbi->s_group_desc); failed_mount: #ifdef CONFIG_QUOTA - for (i = 0; i < MAXQUOTAS; i++) - kfree(sbi->s_qf_names[i]); + for (i = 0; i < MAXQUOTAS; i++) { + if (sbi->s_qf_names[i]) + kfree(sbi->s_qf_names[i]); + } #endif ext3_blkdev_remove(sbi); brelse(bh);