summaryrefslogtreecommitdiffstats
path: root/block/bio.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-09-24 03:43:51 -0400
committerJens Axboe <axboe@kernel.dk>2018-09-24 14:33:55 -0400
commit0e253391a970300fe4ae69d0c1d1ab494eb07508 (patch)
tree4e0ad99680b8d33264620666fc55092140ccba8e /block/bio.c
parent6a9f5f240adfdced863a098d34f8f05ca6ab9d5f (diff)
block: add a missing BIOVEC_SEG_BOUNDARY check in bio_add_pc_page
The actual recaculation of segments in __blk_recalc_rq_segments will do this check, so there is no point in forcing it if we know it won't succeed. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bio.c')
-rw-r--r--block/bio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/bio.c b/block/bio.c
index 81d90b839e05..c254e5aa331f 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -731,7 +731,9 @@ int bio_add_pc_page(struct request_queue *q, struct bio *bio, struct page
731 } 731 }
732 732
733 /* If we may be able to merge these biovecs, force a recount */ 733 /* If we may be able to merge these biovecs, force a recount */
734 if (bio->bi_vcnt > 1 && biovec_phys_mergeable(bvec-1, bvec)) 734 if (bio->bi_vcnt > 1 &&
735 biovec_phys_mergeable(bvec - 1, bvec) &&
736 BIOVEC_SEG_BOUNDARY(q, bvec - 1, bvec))
735 bio_clear_flag(bio, BIO_SEG_VALID); 737 bio_clear_flag(bio, BIO_SEG_VALID);
736 738
737 done: 739 done: