diff --git a/[refs] b/[refs] index 16ea02fe9b6d..a84ad91b0961 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e44543b83bf4ab84dc6bd5b88158c78b1ed1c208 +refs/heads/master: 0f2ddca66d70c8ccba7486cf2d79c6b60e777abd diff --git a/trunk/fs/ext4/super.c b/trunk/fs/ext4/super.c index 9987bba99db3..2958f4e6f222 100644 --- a/trunk/fs/ext4/super.c +++ b/trunk/fs/ext4/super.c @@ -2508,6 +2508,15 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) if (EXT4_BLOCKS_PER_GROUP(sb) == 0) goto cantfind_ext4; + /* check blocks count against device size */ + blocks_count = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits; + if (blocks_count && ext4_blocks_count(es) > blocks_count) { + printk(KERN_WARNING "EXT4-fs: bad geometry: block count %llu " + "exceeds size of device (%llu blocks)\n", + ext4_blocks_count(es), blocks_count); + goto failed_mount; + } + /* * It makes no sense for the first data block to be beyond the end * of the filesystem.