Skip to content

Commit 578270b

Browse files
Ming Leiaxboe
Ming Lei
authored andcommitted
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: 5014c31(block: fix bogus compiler warnings in blk-merge.c) Cc: [email protected] #4.3 Reported-by: Michael Ellerman <[email protected]> Reported-by: Mark Salter <[email protected]> Tested-by: Laurent Dufour <[email protected]> Tested-by: Mark Salter <[email protected]> Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent b094f89 commit 578270b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

block/blk-merge.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
9898

9999
seg_size += bv.bv_len;
100100
bvprv = bv;
101-
bvprvp = &bv;
101+
bvprvp = &bvprv;
102102
sectors += bv.bv_len >> 9;
103103
continue;
104104
}
@@ -108,7 +108,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
108108

109109
nsegs++;
110110
bvprv = bv;
111-
bvprvp = &bv;
111+
bvprvp = &bvprv;
112112
seg_size = bv.bv_len;
113113
sectors += bv.bv_len >> 9;
114114
}

0 commit comments

Comments
 (0)