Skip to content

Commit fc0e982

Browse files
Ming Leiaxboe
authored andcommitted
block: make sure ->nr_integrity_segments is cloned in blk_rq_prep_clone
Make sure ->nr_integrity_segments is cloned in blk_rq_prep_clone(), otherwise requests cloned by device-mapper multipath will not have the proper nr_integrity_segments values set, then BUG() is hit from sg_alloc_table_chained(). Fixes: b0fd271 ("block: add request clone interface (v2)") Cc: [email protected] Cc: Christoph Hellwig <[email protected]> Signed-off-by: Ming Lei <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 5abba4c commit fc0e982

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

block/blk-mq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3314,6 +3314,7 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
33143314
rq->special_vec = rq_src->special_vec;
33153315
}
33163316
rq->nr_phys_segments = rq_src->nr_phys_segments;
3317+
rq->nr_integrity_segments = rq_src->nr_integrity_segments;
33173318

33183319
if (rq->bio && blk_crypto_rq_bio_prep(rq, rq->bio, gfp_mask) < 0)
33193320
goto free_and_out;

0 commit comments

Comments
 (0)