Previously, "mke2fs -t ext4 -O bigalloc /tmp/foo.img 4G ;
e2image /tmp/foo.img /tmp/foo.e2i" would result in e2image
dumping core. Fix ext2fs_image_bitmap_write() so it handles
file systems with bigalloc correctly.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
}
bmap = fs->block_map;
itr = fs->super->s_first_data_block;
- cnt = EXT2_GROUPS_TO_BLOCKS(fs->super, fs->group_desc_count);
- size = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
+ cnt = EXT2_GROUPS_TO_CLUSTERS(fs->super, fs->group_desc_count);
+ size = EXT2_CLUSTERS_PER_GROUP(fs->super) / 8;
}
total_size = size * fs->group_desc_count;