Skip to content

Commit 9c297ec

Browse files
keithbuschaxboe
authored andcommitted
blk-mq: set the nr_integrity_segments from bio
This value is used for merging considerations, so it needs to be accurate. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Keith Busch <kbusch@kernel.org> Link: https://lore.kernel.org/r/20240913182854.2445457-3-kbusch@meta.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 2b01808 commit 9c297ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

block/blk-mq.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,6 +2544,9 @@ static void blk_mq_bio_to_request(struct request *rq, struct bio *bio,
25442544
rq->__sector = bio->bi_iter.bi_sector;
25452545
rq->write_hint = bio->bi_write_hint;
25462546
blk_rq_bio_prep(rq, bio, nr_segs);
2547+
if (bio_integrity(bio))
2548+
rq->nr_integrity_segments = blk_rq_count_integrity_sg(rq->q,
2549+
bio);
25472550

25482551
/* This can't fail, since GFP_NOIO includes __GFP_DIRECT_RECLAIM. */
25492552
err = blk_crypto_rq_bio_prep(rq, bio, GFP_NOIO);

0 commit comments

Comments
 (0)