summaryrefslogtreecommitdiffstats
path: root/block/blk-merge.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2015-11-24 03:35:29 +0100
committerJens Axboe <axboe@fb.com>2015-11-24 04:16:51 +0100
commit578270bfbd2803dc7b0b03fbc2ac119efbc73195 (patch)
treeb326c3879cfde7498f2c3c257951f5ae67b19502 /block/blk-merge.c
parentblk-mq: fix calling unplug callbacks with preempt disabled (diff)
downloadlinux-578270bfbd2803dc7b0b03fbc2ac119efbc73195.tar.xz
linux-578270bfbd2803dc7b0b03fbc2ac119efbc73195.zip
block: fix segment split
Inside blk_bio_segment_split(), previous bvec pointer(bvprvp) always points to the iterator local variable, which is obviously wrong, so fix it by pointing to the local variable of 'bvprv'. Fixes: 5014c311baa2b(block: fix bogus compiler warnings in blk-merge.c) Cc: stable@kernel.org #4.3 Reported-by: Michael Ellerman <mpe@ellerman.id.au> Reported-by: Mark Salter <msalter@redhat.com> Tested-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> Tested-by: Mark Salter <msalter@redhat.com> Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to '')
-rw-r--r--block/blk-merge.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c
index de5716d8e525..f2efe8ae75bb 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -98,7 +98,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
seg_size += bv.bv_len;
bvprv = bv;
- bvprvp = &bv;
+ bvprvp = &bvprv;
sectors += bv.bv_len >> 9;
continue;
}
@@ -108,7 +108,7 @@ new_segment:
nsegs++;
bvprv = bv;
- bvprvp = &bv;
+ bvprvp = &bvprv;
seg_size = bv.bv_len;
sectors += bv.bv_len >> 9;
}