]> www.infradead.org Git - users/jedix/linux-maple.git/commit
blk-integrity: properly account for segments
authorKeith Busch <kbusch@kernel.org>
Fri, 13 Sep 2024 18:28:48 +0000 (11:28 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 13 Sep 2024 18:31:45 +0000 (12:31 -0600)
commitd148d7503456556859c7e4d354115215d8fb5016
treed6c05aa23c52744ca09030fe79dea01d6892a3d3
parent9c297eced59817f461be33e4c241820c5be4bcc1
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>
block/blk-integrity.c
block/blk-merge.c