History

block: fix updating bio's front segment size

When the current bvec can be merged to the 1st segment, the bio's front segment size has to be updated. However, dcebd755926b doesn't consider that case, then bio's front segment size may not be correct. This patch fixes this issue.

Ming Lei committed 7 years ago

Commit aaeee621 parent dfc76d11 file · +8 −0Browse files

Unified · Split

block/blk-merge.c+8−0
@@ -277,6 +277,9 @@ static struct bio *blk_bio_segment_split(struct request_queue *q, · 276 unmodified lines
277 bvprvp = &bvprv;277 bvprvp = &bvprv;
278 sectors += bv.bv_len >> 9;278 sectors += bv.bv_len >> 9;
279 279
280 if (nsegs == 1 && seg_size > front_seg_size)
281 front_seg_size = seg_size;
282
280 continue;283 continue;
281 }284 }
282new_segment:285new_segment:
@@ -401,6 +404,11 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q, · 118 unmodified lines
401 404
402 seg_size += bv.bv_len;405 seg_size += bv.bv_len;
403 bvprv = bv;406 bvprv = bv;
407
408 if (nr_phys_segs == 1 && seg_size >
409 front_seg_size)
410 front_seg_size = seg_size;
411
404 continue;412 continue;
405 }413 }
406new_segment:414new_segment:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t