remove the next_bvec label in __blk_bios_map_sg(), simplify the logic of traversal bvec. Signed-off-by: sh <sh_def@xxxxxxx> --- block/blk-merge.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 808768f6b174..aa113cbc0f35 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -494,15 +494,15 @@ static int __blk_bios_map_sg(struct request_queue *q, struct bio *bio, * to bio */ if (new_bio && - __blk_segment_map_sg_merge(q, &bvec, &bvprv, sg)) - goto next_bvec; + __blk_segment_map_sg_merge(q, &bvec, &bvprv, sg)) { + new_bio = false; + continue; + } if (bvec.bv_offset + bvec.bv_len <= PAGE_SIZE) nsegs += __blk_bvec_map_sg(bvec, sglist, sg); else nsegs += blk_bvec_map_sg(q, &bvec, sglist, sg); - next_bvec: - new_bio = false; } if (likely(bio->bi_iter.bi_size)) { bvprv = bvec; -- 2.25.1