提交 0e253391 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

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: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 6a9f5f24
...@@ -731,7 +731,9 @@ int bio_add_pc_page(struct request_queue *q, struct bio *bio, struct page ...@@ -731,7 +731,9 @@ int bio_add_pc_page(struct request_queue *q, struct bio *bio, struct page
} }
/* If we may be able to merge these biovecs, force a recount */ /* If we may be able to merge these biovecs, force a recount */
if (bio->bi_vcnt > 1 && biovec_phys_mergeable(bvec-1, bvec)) if (bio->bi_vcnt > 1 &&
biovec_phys_mergeable(bvec - 1, bvec) &&
BIOVEC_SEG_BOUNDARY(q, bvec - 1, bvec))
bio_clear_flag(bio, BIO_SEG_VALID); bio_clear_flag(bio, BIO_SEG_VALID);
done: done:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册