Commit ff06e6e5 authored by Wenbo Wang's avatar Wenbo Wang Committed by Sasha Levin

Fix bug in blk_rq_merge_ok

[ Upstream commit 7ee8e4f3 ]

Use the right array index to reference the last
element of rq->biotail->bi_io_vec[]
Signed-off-by: default avatarWenbo Wang <wenbo.wang@memblaze.com>
Reviewed-by: default avatarChong Yuan <chong.yuan@memblaze.com>
Fixes: 66cb45aa ("block: add support for limiting gaps in SG lists")
Cc: stable@kernel.org
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent 06767df2
......@@ -609,7 +609,7 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
if (q->queue_flags & (1 << QUEUE_FLAG_SG_GAPS)) {
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))
return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment