Commit 278b54df authored by Ming Lei's avatar Ming Lei Committed by Greg Kroah-Hartman

block: fix segment split

commit 578270bf 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: 5014c311(block: fix bogus compiler warnings in blk-merge.c)
Reported-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Reported-by: default avatarMark Salter <msalter@redhat.com>
Tested-by: default avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
Tested-by: default avatarMark Salter <msalter@redhat.com>
Signed-off-by: default avatarMing Lei <ming.lei@canonical.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eeec50cb
......@@ -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 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
nsegs++;
bvprv = bv;
bvprvp = &bv;
bvprvp = &bvprv;
seg_size = bv.bv_len;
sectors += bv.bv_len >> 9;
}
......
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