diff options
author | Ming Lei <ming.lei@redhat.com> | 2025-03-10 19:54:53 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-05-02 07:58:54 +0200 |
commit | 2afa5ea7c48dae11c642f8e7d4479b261c3139dc (patch) | |
tree | 0eb2fa58a33baef8111f424e473577a22901e38c | |
parent | ed7535b141161f71c5f03a2bce361a0ca842c166 (diff) |
block: make sure ->nr_integrity_segments is cloned in blk_rq_prep_clone
[ Upstream commit fc0e982b8a3a169b1c654d9a1aa45bf292943ef2 ]
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: b0fd271d5fba ("block: add request clone interface (v2)")
Cc: stable@vger.kernel.org
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250310115453.2271109-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | block/blk-mq.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 5e6afda59e7a..a7765e96cf40 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3306,6 +3306,7 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src, rq->special_vec = rq_src->special_vec; } rq->nr_phys_segments = rq_src->nr_phys_segments; + rq->nr_integrity_segments = rq_src->nr_integrity_segments; if (rq->bio && blk_crypto_rq_bio_prep(rq, rq->bio, gfp_mask) < 0) goto free_and_out; |