diff options
| -rw-r--r-- | fs/ext4/mballoc.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 11568697b192..37d2438e0cb4 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
| @@ -2697,9 +2697,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac, | |||
| 2697 | if (err) | 2697 | if (err) |
| 2698 | goto out_err; | 2698 | goto out_err; |
| 2699 | 2699 | ||
| 2700 | block = ac->ac_b_ex.fe_group * EXT4_BLOCKS_PER_GROUP(sb) | 2700 | block = ext4_grp_offs_to_block(sb, &ac->ac_b_ex); |
| 2701 | + ac->ac_b_ex.fe_start | ||
| 2702 | + le32_to_cpu(es->s_first_data_block); | ||
| 2703 | 2701 | ||
| 2704 | len = ac->ac_b_ex.fe_len; | 2702 | len = ac->ac_b_ex.fe_len; |
| 2705 | if (!ext4_data_block_valid(sbi, block, len)) { | 2703 | if (!ext4_data_block_valid(sbi, block, len)) { |
| @@ -3154,9 +3152,7 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac) | |||
| 3154 | /* The max size of hash table is PREALLOC_TB_SIZE */ | 3152 | /* The max size of hash table is PREALLOC_TB_SIZE */ |
| 3155 | order = PREALLOC_TB_SIZE - 1; | 3153 | order = PREALLOC_TB_SIZE - 1; |
| 3156 | 3154 | ||
| 3157 | goal_block = ac->ac_g_ex.fe_group * EXT4_BLOCKS_PER_GROUP(ac->ac_sb) + | 3155 | goal_block = ext4_grp_offs_to_block(ac->ac_sb, &ac->ac_g_ex); |
| 3158 | ac->ac_g_ex.fe_start + | ||
| 3159 | le32_to_cpu(EXT4_SB(ac->ac_sb)->s_es->s_first_data_block); | ||
| 3160 | /* | 3156 | /* |
| 3161 | * search for the prealloc space that is having | 3157 | * search for the prealloc space that is having |
| 3162 | * minimal distance from the goal block. | 3158 | * minimal distance from the goal block. |
