Skip to content

Commit

Permalink
block: still try to split bio if the bvec crosses pages
Browse files Browse the repository at this point in the history
Some device may set segment boundary as PAGE_SIZE - 1. If the bvec
crosses pages, and meantime its length is <= PAGE_SIZE, we still need
to split the bvec into 2 segments.

Fixes this issue by still splitting bio if the single bvec crosses
pages.

Reported-by: kernel test robot <[email protected]>
Fixes: fa53228 (block: avoid blk_bio_segment_split for small I/O operations)
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Ming Lei authored and axboe committed Nov 8, 2019
1 parent 1d15664 commit 59db8ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/blk-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ void __blk_queue_split(struct request_queue *q, struct bio **bio,
*/
if (!q->limits.chunk_sectors &&
(*bio)->bi_vcnt == 1 &&
(*bio)->bi_io_vec[0].bv_len <= PAGE_SIZE) {
((*bio)->bi_io_vec[0].bv_len +
(*bio)->bi_io_vec[0].bv_offset) <= PAGE_SIZE) {
*nr_segs = 1;
break;
}
Expand Down

0 comments on commit 59db8ba

Please sign in to comment.