Skip to content

Commit

Permalink
block: fix segment split
Browse files Browse the repository at this point in the history
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: 5014c31(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>
  • Loading branch information
Ming Lei authored and Jens Axboe committed Nov 24, 2015
1 parent b094f89 commit 578270b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/blk-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -108,7 +108,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;
}
Expand Down

0 comments on commit 578270b

Please sign in to comment.