Skip to content

Commit

Permalink
Fix bug in blk_rq_merge_ok
Browse files Browse the repository at this point in the history
Use the right array index to reference the last
element of rq->biotail->bi_io_vec[]

Signed-off-by: Wenbo Wang <[email protected]>
Reviewed-by: Chong Yuan <[email protected]>
Fixes: 66cb45a ("block: add support for limiting gaps in SG lists")
Cc: [email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Wenbo Wang authored and axboe committed Mar 20, 2015
1 parent bc188d8 commit 7ee8e4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,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;
}
Expand Down

0 comments on commit 7ee8e4f

Please sign in to comment.