diff options
author | Stefan Brüns <stefan.bruens@rwth-aachen.de> | 2016-09-17 02:10:07 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-09-23 09:18:56 -0400 |
commit | fc214ef90910159f33fbe92a6cb77839a27fa8a6 (patch) | |
tree | 2e6b1fc13ed19e24b3992d6fd10197a4ee82da41 /fs | |
parent | 3ee2f977f3649bcc1d0de86356145e8e6999575a (diff) |
ext4: determine group descriptor size for 64bit feature
If EXT4_FEATURE_INCOMPAT_64BIT is set, the descriptor can be read from
the superblocks, otherwise it defaults to 32.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/ext4_common.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c index 5f21dc79480..2df4f8b6d91 100644 --- a/fs/ext4/ext4_common.c +++ b/fs/ext4/ext4_common.c @@ -2233,13 +2233,23 @@ int ext4fs_mount(unsigned part_length) goto fail; } - if (le32_to_cpu(data->sblock.revision_level) == 0) + if (le32_to_cpu(data->sblock.revision_level) == 0) { fs->inodesz = 128; - else + } else { + debug("EXT4 features COMPAT: %08x INCOMPAT: %08x RO_COMPAT: %08x\n", + __le32_to_cpu(data->sblock.feature_compatibility), + __le32_to_cpu(data->sblock.feature_incompat), + __le32_to_cpu(data->sblock.feature_ro_compat)); + fs->inodesz = le16_to_cpu(data->sblock.inode_size); + fs->gdsize = le32_to_cpu(data->sblock.feature_incompat) & + EXT4_FEATURE_INCOMPAT_64BIT ? + le16_to_cpu(data->sblock.descriptor_size) : 32; + } - debug("EXT2 rev %d, inode_size %d\n", - le32_to_cpu(data->sblock.revision_level), fs->inodesz); + debug("EXT2 rev %d, inode_size %d, descriptor size %d\n", + le32_to_cpu(data->sblock.revision_level), + fs->inodesz, fs->gdsize); data->diropen.data = data; data->diropen.ino = 2; |