diff options
| -rw-r--r-- | fs/ext4/balloc.c | 4 | ||||
| -rw-r--r-- | fs/ext4/super.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 58339393fa6e..ddd715e42a5c 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 85b3dd60169b..8862d4ddf71f 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -3624,10 +3624,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3624 | sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb)); | 3624 | sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb)); |
| 3625 | sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb)); | 3625 | sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb)); |
| 3626 | 3626 | ||
| 3627 | /* Do we have standard group size of blocksize * 8 blocks ? */ | ||
| 3628 | if (sbi->s_blocks_per_group == blocksize << 3) | ||
| 3629 | set_opt2(sb, STD_GROUP_SIZE); | ||
| 3630 | |||
| 3631 | for (i = 0; i < 4; i++) | 3627 | for (i = 0; i < 4; i++) |
| 3632 | sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]); | 3628 | sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]); |
| 3633 | sbi->s_def_hash_version = es->s_def_hash_version; | 3629 | sbi->s_def_hash_version = es->s_def_hash_version; |
| @@ -3697,6 +3693,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3697 | goto failed_mount; | 3693 | goto failed_mount; |
| 3698 | } | 3694 | } |
| 3699 | 3695 | ||
| 3696 | /* Do we have standard group size of clustersize * 8 blocks ? */ | ||
| 3697 | if (sbi->s_blocks_per_group == clustersize << 3) | ||
| 3698 | set_opt2(sb, STD_GROUP_SIZE); | ||
| 3699 | |||
| 3700 | /* | 3700 | /* |
| 3701 | * Test whether we have more sectors than will fit in sector_t, | 3701 | * Test whether we have more sectors than will fit in sector_t, |
| 3702 | * and whether the max offset is addressable by the page cache. | 3702 | * and whether the max offset is addressable by the page cache. |
