ext4: Fix 64bit feature
commitaf7e95c32cea40c1e443ae301e64b27f068b4915
authorPaulo Alcantara <pcacjr@zytor.com>
Wed, 11 Oct 2017 11:00:31 +0000 (11 07:00 -0400)
committerGene Cumm <gene.cumm@gmail.com>
Sun, 15 Oct 2017 11:03:33 +0000 (15 07:03 -0400)
treeaeeb026a6f13f864ef036313074b6b46890cdd18
parentc100204000cdc565e5edaec1b8a6239143173fbd
ext4: Fix 64bit feature

As per ext4 specification:

> In ext2, ext3, and ext4 (when the 64bit feature is not enabled), the
> block group descriptor was only 32 bytes long and therefore ends at
> bg_checksum. On an ext4 filesystem with the 64bit feature enabled, the
> block group descriptor expands to at least the 64 bytes described below;
> the size is stored in the superblock.

Since block group descriptor has been expanded to 64 bytes long (when 64
bit feature is enabled), we cannot index ext2_group_desc and return it
*directly* -- as we did it in ext2_get_group_desc -- it's still 32 bytes
long.

Instead, use s_desc_size field from superblock to correctly index and
return block group descriptors.

Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
core/fs/ext2/ext2.c
core/fs/ext2/ext2_fs.h