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
277277 bvprvp = &bvprv;
278278 sectors += bv.bv_len >> 9;
279279
280+ if (nsegs == 1 && seg_size > front_seg_size)
281+ front_seg_size = seg_size;
282+
280283 continue;
281284 }
282285 new_segment:
@@ -401,6 +404,11 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q, · 118 unmodified lines
401404
402405 seg_size += bv.bv_len;
403406 bvprv = bv;
407+
408+ if (nr_phys_segs == 1 && seg_size >
409+ front_seg_size)
410+ front_seg_size = seg_size;
411+
404412 continue;
405413 }
406414 new_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