aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/mballoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/mballoc.c')
-rw-r--r--fs/ext4/mballoc.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 833d87236881..1a9cd7de04dd 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3184,23 +3184,18 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
3184 BUG_ON(!(ac->ac_o_ex.fe_logical >= pa_end || 3184 BUG_ON(!(ac->ac_o_ex.fe_logical >= pa_end ||
3185 ac->ac_o_ex.fe_logical < pa->pa_lstart)); 3185 ac->ac_o_ex.fe_logical < pa->pa_lstart));
3186 3186
3187 /* skip PA normalized request doesn't overlap with */ 3187 /* skip PAs this normalized request doesn't overlap with */
3188 if (pa->pa_lstart >= end) { 3188 if (pa->pa_lstart >= end || pa_end <= start) {
3189 spin_unlock(&pa->pa_lock);
3190 continue;
3191 }
3192 if (pa_end <= start) {
3193 spin_unlock(&pa->pa_lock); 3189 spin_unlock(&pa->pa_lock);
3194 continue; 3190 continue;
3195 } 3191 }
3196 BUG_ON(pa->pa_lstart <= start && pa_end >= end); 3192 BUG_ON(pa->pa_lstart <= start && pa_end >= end);
3197 3193
3194 /* adjust start or end to be adjacent to this pa */
3198 if (pa_end <= ac->ac_o_ex.fe_logical) { 3195 if (pa_end <= ac->ac_o_ex.fe_logical) {
3199 BUG_ON(pa_end < start); 3196 BUG_ON(pa_end < start);
3200 start = pa_end; 3197 start = pa_end;
3201 } 3198 } else if (pa->pa_lstart > ac->ac_o_ex.fe_logical) {
3202
3203 if (pa->pa_lstart > ac->ac_o_ex.fe_logical) {
3204 BUG_ON(pa->pa_lstart > end); 3199 BUG_ON(pa->pa_lstart > end);
3205 end = pa->pa_lstart; 3200 end = pa->pa_lstart;
3206 } 3201 }