提交 578270bf 编写于 作者: M Ming Lei 提交者: Jens Axboe

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: 5014c311(block: fix bogus compiler warnings in blk-merge.c)
Cc: stable@kernel.org #4.3
Reported-by: NMichael Ellerman <mpe@ellerman.id.au>
Reported-by: NMark Salter <msalter@redhat.com>
Tested-by: NLaurent Dufour <ldufour@linux.vnet.ibm.com>
Tested-by: NMark Salter <msalter@redhat.com>
Signed-off-by: NMing Lei <ming.lei@canonical.com>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 b094f89c
...@@ -98,7 +98,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q, ...@@ -98,7 +98,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
seg_size += bv.bv_len; seg_size += bv.bv_len;
bvprv = bv; bvprv = bv;
bvprvp = &bv; bvprvp = &bvprv;
sectors += bv.bv_len >> 9; sectors += bv.bv_len >> 9;
continue; continue;
} }
...@@ -108,7 +108,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q, ...@@ -108,7 +108,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
nsegs++; nsegs++;
bvprv = bv; bvprv = bv;
bvprvp = &bv; bvprvp = &bvprv;
seg_size = bv.bv_len; seg_size = bv.bv_len;
sectors += bv.bv_len >> 9; sectors += bv.bv_len >> 9;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册