diff options
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/resize.c | 10 | ||||
-rw-r--r-- | fs/ext3/super.c | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c index 34b39e9a1e5a..a31dff81ed77 100644 --- a/fs/ext3/resize.c +++ b/fs/ext3/resize.c | |||
@@ -925,6 +925,16 @@ int ext3_group_extend(struct super_block *sb, struct ext3_super_block *es, | |||
925 | if (n_blocks_count == 0 || n_blocks_count == o_blocks_count) | 925 | if (n_blocks_count == 0 || n_blocks_count == o_blocks_count) |
926 | return 0; | 926 | return 0; |
927 | 927 | ||
928 | if (n_blocks_count > (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) { | ||
929 | printk(KERN_ERR "EXT3-fs: filesystem on %s:" | ||
930 | " too large to resize to %lu blocks safely\n", | ||
931 | sb->s_id, n_blocks_count); | ||
932 | if (sizeof(sector_t) < 8) | ||
933 | ext3_warning(sb, __FUNCTION__, | ||
934 | "CONFIG_LBD not enabled\n"); | ||
935 | return -EINVAL; | ||
936 | } | ||
937 | |||
928 | if (n_blocks_count < o_blocks_count) { | 938 | if (n_blocks_count < o_blocks_count) { |
929 | ext3_warning(sb, __FUNCTION__, | 939 | ext3_warning(sb, __FUNCTION__, |
930 | "can't shrink FS - resize aborted"); | 940 | "can't shrink FS - resize aborted"); |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index a60cc6ec130f..df98a7709252 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -1565,6 +1565,16 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) | |||
1565 | goto failed_mount; | 1565 | goto failed_mount; |
1566 | } | 1566 | } |
1567 | 1567 | ||
1568 | if (le32_to_cpu(es->s_blocks_count) > | ||
1569 | (sector_t)(~0ULL) >> (sb->s_blocksize_bits - 9)) { | ||
1570 | printk(KERN_ERR "EXT3-fs: filesystem on %s:" | ||
1571 | " too large to mount safely\n", sb->s_id); | ||
1572 | if (sizeof(sector_t) < 8) | ||
1573 | printk(KERN_WARNING "EXT3-fs: CONFIG_LBD not " | ||
1574 | "enabled\n"); | ||
1575 | goto failed_mount; | ||
1576 | } | ||
1577 | |||
1568 | if (EXT3_BLOCKS_PER_GROUP(sb) == 0) | 1578 | if (EXT3_BLOCKS_PER_GROUP(sb) == 0) |
1569 | goto cantfind_ext3; | 1579 | goto cantfind_ext3; |
1570 | sbi->s_groups_count = (le32_to_cpu(es->s_blocks_count) - | 1580 | sbi->s_groups_count = (le32_to_cpu(es->s_blocks_count) - |