1 ext4: Convert to host order before using the values.
3 From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
5 Use le16_to_cpu to read the s_reserved_gdt_blocks values
8 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
9 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 fs/ext4/super.c | 5 ++---
12 1 files changed, 2 insertions(+), 3 deletions(-)
14 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
15 index 87ac84b..5bfc235 100644
18 @@ -1464,9 +1464,8 @@ static int ext4_fill_flex_info(struct super_block *sb)
20 /* We allocate both existing and potentially added groups */
21 flex_group_count = ((sbi->s_groups_count + groups_per_flex - 1) +
22 - ((sbi->s_es->s_reserved_gdt_blocks +1 ) <<
23 - EXT4_DESC_PER_BLOCK_BITS(sb))) /
25 + ((le16_to_cpu(sbi->s_es->s_reserved_gdt_blocks) + 1) <<
26 + EXT4_DESC_PER_BLOCK_BITS(sb))) / groups_per_flex;
27 sbi->s_flex_groups = kzalloc(flex_group_count *
28 sizeof(struct flex_groups), GFP_KERNEL);
29 if (sbi->s_flex_groups == NULL) {