aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext4/balloc.c4
-rw-r--r--fs/ext4/super.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index d0f13eada0ed..3742e4c85723 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -38,8 +38,8 @@ ext4_group_t ext4_get_group_number(struct super_block *sb,
38 ext4_group_t group; 38 ext4_group_t group;
39 39
40 if (test_opt2(sb, STD_GROUP_SIZE)) 40 if (test_opt2(sb, STD_GROUP_SIZE))
41 group = (le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block) + 41 group = (block -
42 block) >> 42 le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block)) >>
43 (EXT4_BLOCK_SIZE_BITS(sb) + EXT4_CLUSTER_BITS(sb) + 3); 43 (EXT4_BLOCK_SIZE_BITS(sb) + EXT4_CLUSTER_BITS(sb) + 3);
44 else 44 else
45 ext4_get_group_no_and_offset(sb, block, &group, NULL); 45 ext4_get_group_no_and_offset(sb, block, &group, NULL);
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 94cc84db7c9a..9751333d8030 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3586,10 +3586,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
3586 sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb)); 3586 sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb));
3587 sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb)); 3587 sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb));
3588 3588
3589 /* Do we have standard group size of blocksize * 8 blocks ? */
3590 if (sbi->s_blocks_per_group == blocksize << 3)
3591 set_opt2(sb, STD_GROUP_SIZE);
3592
3593 for (i = 0; i < 4; i++) 3589 for (i = 0; i < 4; i++)
3594 sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]); 3590 sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]);
3595 sbi->s_def_hash_version = es->s_def_hash_version; 3591 sbi->s_def_hash_version = es->s_def_hash_version;
@@ -3659,6 +3655,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
3659 goto failed_mount; 3655 goto failed_mount;
3660 } 3656 }
3661 3657
3658 /* Do we have standard group size of clustersize * 8 blocks ? */
3659 if (sbi->s_blocks_per_group == clustersize << 3)
3660 set_opt2(sb, STD_GROUP_SIZE);
3661
3662 /* 3662 /*
3663 * Test whether we have more sectors than will fit in sector_t, 3663 * Test whether we have more sectors than will fit in sector_t,
3664 * and whether the max offset is addressable by the page cache. 3664 * and whether the max offset is addressable by the page cache.