提交 7ee8e4f3 编写于 作者: W Wenbo Wang 提交者: Jens Axboe

Fix bug in blk_rq_merge_ok

Use the right array index to reference the last
element of rq->biotail->bi_io_vec[]
Signed-off-by: NWenbo Wang <wenbo.wang@memblaze.com>
Reviewed-by: NChong Yuan <chong.yuan@memblaze.com>
Fixes: 66cb45aa ("block: add support for limiting gaps in SG lists")
Cc: stable@kernel.org
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 bc188d81
...@@ -592,7 +592,7 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio) ...@@ -592,7 +592,7 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
if (q->queue_flags & (1 << QUEUE_FLAG_SG_GAPS)) { if (q->queue_flags & (1 << QUEUE_FLAG_SG_GAPS)) {
struct bio_vec *bprev; struct bio_vec *bprev;
bprev = &rq->biotail->bi_io_vec[bio->bi_vcnt - 1]; bprev = &rq->biotail->bi_io_vec[rq->biotail->bi_vcnt - 1];
if (bvec_gap_to_prev(bprev, bio->bi_io_vec[0].bv_offset)) if (bvec_gap_to_prev(bprev, bio->bi_io_vec[0].bv_offset))
return false; return false;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册