diff options
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 9987bba99db3..2958f4e6f222 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -2508,6 +2508,15 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
2508 | if (EXT4_BLOCKS_PER_GROUP(sb) == 0) | 2508 | if (EXT4_BLOCKS_PER_GROUP(sb) == 0) |
2509 | goto cantfind_ext4; | 2509 | goto cantfind_ext4; |
2510 | 2510 | ||
2511 | /* check blocks count against device size */ | ||
2512 | blocks_count = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits; | ||
2513 | if (blocks_count && ext4_blocks_count(es) > blocks_count) { | ||
2514 | printk(KERN_WARNING "EXT4-fs: bad geometry: block count %llu " | ||
2515 | "exceeds size of device (%llu blocks)\n", | ||
2516 | ext4_blocks_count(es), blocks_count); | ||
2517 | goto failed_mount; | ||
2518 | } | ||
2519 | |||
2511 | /* | 2520 | /* |
2512 | * It makes no sense for the first data block to be beyond the end | 2521 | * It makes no sense for the first data block to be beyond the end |
2513 | * of the filesystem. | 2522 | * of the filesystem. |