summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2015-11-24 10:35:29 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-14 21:41:09 -0800
commit278b54df14299e1cfbe6175e2a098bf0b6616611 (patch)
tree03868fa9bebc50ab434d0cd8a16ebec264150f31
parenteeec50cb5826af4c70564ed49d88626439598327 (diff)
downloadlwn-278b54df14299e1cfbe6175e2a098bf0b6616611.tar.gz
lwn-278b54df14299e1cfbe6175e2a098bf0b6616611.zip
block: fix segment split
commit 578270bfbd2803dc7b0b03fbc2ac119efbc73195 upstream. 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) 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 c4e9c37f3e38..0e5f4fc12449 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -91,7 +91,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;
}
@@ -101,7 +101,7 @@ new_segment:
nsegs++;
bvprv = bv;
- bvprvp = &bv;
+ bvprvp = &bvprv;
seg_size = bv.bv_len;
sectors += bv.bv_len >> 9;
}