summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorWenbo Wang <wenbo.wang@memblaze.com>2015-03-20 01:04:54 -0400
committerSasha Levin <sasha.levin@oracle.com>2015-04-22 23:32:31 -0400
commitff06e6e533db84a5cbce79d1b4866e8258b563c9 (patch)
treeea2fba9c9a2b60bb7e7e81db68d8fe441b0fae40 /block
parent06767df2716dd228bc94696862f165d14e5cc756 (diff)
downloadlinux-stable-ff06e6e533db84a5cbce79d1b4866e8258b563c9.tar.gz
linux-stable-ff06e6e533db84a5cbce79d1b4866e8258b563c9.tar.bz2
linux-stable-ff06e6e533db84a5cbce79d1b4866e8258b563c9.zip
Fix bug in blk_rq_merge_ok
[ Upstream commit 7ee8e4f3983c4ff700958a6099c8fd212ea67b94 ] Use the right array index to reference the last element of rq->biotail->bi_io_vec[] Signed-off-by: Wenbo Wang <wenbo.wang@memblaze.com> Reviewed-by: Chong Yuan <chong.yuan@memblaze.com> Fixes: 66cb45aa41315 ("block: add support for limiting gaps in SG lists") Cc: stable@kernel.org Signed-off-by: Jens Axboe <axboe@fb.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-merge.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 89b97b5e0881..2be75ff7f171 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -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;
}