summaryrefslogtreecommitdiffstats
path: root/block/blk-integrity.c
diff options
context:
space:
mode:
authorKeith Busch <kbusch@kernel.org>2024-09-13 20:28:48 +0200
committerJens Axboe <axboe@kernel.dk>2024-09-13 20:31:45 +0200
commitd148d7503456556859c7e4d354115215d8fb5016 (patch)
treed6c05aa23c52744ca09030fe79dea01d6892a3d3 /block/blk-integrity.c
parentblk-mq: set the nr_integrity_segments from bio (diff)
downloadlinux-d148d7503456556859c7e4d354115215d8fb5016.tar.xz
linux-d148d7503456556859c7e4d354115215d8fb5016.zip
blk-integrity: properly account for segments
Both types of merging when integrity data is used are miscounting the segments: Merging two requests wasn't accounting for the new segment count, so add the "next" segment count to the first on a successful merge to ensure this value is accurate. Merging a bio into an existing request was double counting the bio's segments, even if the merge failed later on. Move the segment accounting to the end when the merge is successful. 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-4-kbusch@meta.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-integrity.c')
-rw-r--r--block/blk-integrity.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/block/blk-integrity.c b/block/blk-integrity.c
index 010decc892ea..afd101555d3c 100644
--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -153,8 +153,6 @@ bool blk_integrity_merge_bio(struct request_queue *q, struct request *req,
q->limits.max_integrity_segments)
return false;
- req->nr_integrity_segments += nr_integrity_segs;
-
return true;
}